tags:

views:

119

answers:

4

Hi All,

I'm looking for an open source utility that will allow me to generate .pdfs from fairly simple xml or html. There may be linked images as well as plain text. There will not be css or javascript. Ideally I'd like the generated pdf to be parsable, i.e. so that the content is not an image. Googling around I see there's IText and PdfBox. Is there anything to recommend one over the other?

Thanks Richard.

A: 

Have a look at XML Formatting Objects, it will let you generate PDFs fairly easy from XML.

ilikeorangutans
+4  A: 

Apache FOP is a Java library that can covert XSL Formatting Objects (XSL-FO) to PDF

David Holbrook
you should explain that this it uses XSL-FO, not simple html.
Bozho
ok thanks. XSL_FO is new to me, but may well be something I could use
Richard
Expanded description and pointed to Wikipedia article pointed out by ilikeorangutans in his answer
David Holbrook
+1 This is a great library. There's a bit of a learning curve but it works exceptionally well.
Chris Thompson
+2  A: 

You can also consider a combination of Flying Saucer (XHTMLRenderer) and the well known iText.

You can find a blog with code samples here.

BalusC
A: 

It does not meet your restrictions for being open source, and I can see how that would be a deal breaker, but if you can afford it, Prince is absolutely excellent at this task. And if you needed it to also do css for more advanced layout and styling, it can do so easily. I am currently using it for a Java web application and it works extremely well.

Russell Leggett