Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

looking for tool to convert xml to pdf

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chris Shellenbarger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic