Create PDF with Java

hogni89 picture hogni89 · Sep 8, 2011 · Viewed 245.3k times · Source

Possible Duplicate:
PDF Generation Library for Java

I'm working on an invoice program for a local accounting company. What is a good way to create a PDF file with Java? Any good library? I'm totally new to PDF export (On any language).

Answer

Philipp Reichart picture Philipp Reichart · Sep 9, 2011

I prefer outputting my data into XML (using Castor, XStream or JAXB), then transforming it using a XSLT stylesheet into XSL-FO and render that with Apache FOP into PDF. Worked so far for 10-page reports and 400-page manuals. I found this more flexible and stylable than generating PDFs in code using iText.