Converting xml to pdf using mfc

hello friends,
   i need to convert xml file to pdf format,there i an library called HTMLDOC but its not clear,i possible suggest me.
Who is Participating?
Computer101Connect With a Mentor Commented:
PAQed - no points refunded (of 125)

E-E Admin
AndyAinscowFreelance programmer / ConsultantCommented:
This isn't an MFC method.
Install a printer driver that writes a pdf file (eg see
Print the XML file and choose the 'pdf printer'.  That will usually prompt for a filename/path and there you have your pdf file.
Karl Heinz KremerCommented:
I suspect you don't want to just print your XML to a PDF file, but convert the data in the XML file to a PDF file.

Look at Apache's XML  FOP project (, which does exactly that: You describe how the XML data is supposed to be converte to other formats, and then the program creates this other format for you. One of the supported output formats is PDF.

The Apache software is free, and you can incorporate it into your own project (the only problem may be that it's written in Java).
There are however other solutions available, one example is
Apoc XSL-FO - an XSL-FO renderer for .NET (it's based on the Apache solution)

Even if this is not exactly what you are looking for, I still think that the XSL-FO (or xsl:fo) object formatting is how you would go from XML to PDF.
Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Karl Heinz KremerCommented:
Here is another link for a converter:

BTW: HTMLDOC only converts (X)HTML to PDF, so it would not work with XML.
Karl Heinz KremerCommented:
I think I provided the correct solution.
AndyAinscowFreelance programmer / ConsultantCommented:
I provided a general method of creating any document into pdf.
Karl Heinz KremerCommented:
Yes, you provided the general method, which unfortunately in this case is not the right approach: It will give you a PDF document that contains the XML code (potentially nicely formatted). What the asker was after is converting the content of the XML file to PFD, and XSL-FO is the best approach for this.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.