Solved

Converting xml to pdf using mfc

Posted on 2003-11-26
9
221 Views
Last Modified: 2013-11-25
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.
bye
0
Comment
Question by:prasanna_k
  • 4
  • 2
9 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9824524
This isn't an MFC method.
Install a printer driver that writes a pdf file (eg see www.pdf995.com).
Print the XML file and choose the 'pdf printer'.  That will usually prompt for a filename/path and there you have your pdf file.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9824898
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 (http://xml.apache.org/fop/index.html), 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  http://www.chive.com/ - 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.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9824909
Here is another link for a converter: http://xml.coverpages.org/rahtzPassiveTex11AnnBL.html

BTW: HTMLDOC only converts (X)HTML to PDF, so it would not work with XML.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11848126
I think I provided the correct solution.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11849591
I provided a general method of creating any document into pdf.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11850344
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.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11984817
PAQed - no points refunded (of 125)

Computer101
E-E Admin
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 105
WPF - External data binding to controls inside a UserControl 2 62
Problem to open Excel file 15 130
Question to Pivot table 1 51
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question