• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

looking for tool to convert xml to pdf

 
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 28749
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic