Solved

Converting xml to pdf using mfc

Posted on 2003-11-26
9
219 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
I think I provided the correct solution.
0
 
LVL 44

Expert Comment

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

Expert Comment

by:Karl Heinz Kremer
Comment Utility
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
Comment Utility
PAQed - no points refunded (of 125)

Computer101
E-E Admin
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now