aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes looking for tool to convert xml to pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "looking for tool to convert xml to pdf " Watch "looking for tool to convert xml to pdf " New topic
Author

looking for tool to convert xml to pdf

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
Hello all
i have xml that has been formatted with xsl to html kind of view
is there any tool ( other then fop ) to take xml and convert it to pdf ?
thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42916
    
  68
Apache FOP converts XML to PDF (and other formats) with the help of XSL-FO stylesheets. So if you already have XSLT stylesheets for a transformation to HTML, it may not be a lot of work to derive some XSL-FO stylesheets from those.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

FOP is actually the stylesheets that take XML markup files and convert them to their PDF equivalents. I use Xalan to run FOP, but there are other projects that can do so as well.

In Linux, there's a wealth of text and graphics conversion tools, such as enscript. You'd probably want to create some sort of XML markup conversion such as XML-to-postscript and then pass the results on to another tool in the chain. Docbook is an XML markup format typically processed by OpenJADE, for example.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Tim Holloway:
FOP is actually the stylesheets that take XML markup files and convert them to their PDF equivalents. I use Xalan to run FOP, but there are other projects that can do so as well.


Uh, I think you confused something here.

XSL-T is the stylesheet format that takes XML files and converts them to some other format (though not PDF).

Xalan is Apache's XSL-T processor.

XSL-FO is a page description language.

FOP is Apache's XSL-FO processor, which can create PDF from an XSL-FO file.

A typical process to generate PDF from some arbitrary XML is to use XSL-T to transform the information to XSL-FO, and then rendering the XSL-FO to PDF.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Chris Shellenbarger
Greenhorn

Joined: Mar 14, 2006
Posts: 3
I personally can't stand XSL-FO - but I just did a project with a similar requirement and I used iText (http://www.lowagie.com/iText/). If you have an existing PDF you can add fields to it then convert your source XML into the XFDF format for your fields and it will fill in the appropriate fields.

It also can be used to create PDFs from scratch.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
I've used FOP in the past. It wasn't bad, once you get the hang of it.
Beats coding SLK by hand (which I've also done) to generate XLS files out of thin air.


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: looking for tool to convert xml to pdf