Compare these products for PDF generation with Java given requirements inside: iText, Apache PDFBox or FOP?

  1. iText; nowadays iText is a commercial library, the latest version is not for free anymore (a fork of an older version remains under MIT license: OpenPDF)
  2. FOP; I worked a lot with FOP. It's fairly resource intensive (Java > XML > XSLT > PDF) and complex PDFs become a nightmare ( may result in XSLTs with 20k+ LoC)
  3. PDFBox; it seems to be the best alternative although I did not work with it in large projects
  4. Did not check Flying Saucer yet

To conclude, I'd give PDFBox a try. Depending on your bar code requirements you may need to inline your barcode (font) into the PDF or distribute the font to your clients - take care of those issues.


I've done a project with Flying Saucer http://code.google.com/p/flying-saucer/ which is based on iText. It's free, easy to use, has great support for CSS, and has nice open source.


I think your criteria can be met with both iText and Apahce FOp but here you have some additional criteria:

  • licensing: FOP is based on Apache license and therefore "friendly" also for commercial use
  • flexbility: a low level API like iText is more flexible than high level FOP
  • Visual tools: there is one designer for FOP here.
  • Programing Model: iText is based on programming API while FOP requires a XSLFO template and less programming.
  • Proprietary vs standard. Apache FOP is based on a standard and therefore vendor independent, while iText is a proprietaRy API
  • Performace: It is said FOP is more computing intensive. it depends of course of what your target PDF files are. It was a never issue for me using FOP.

I would not use PDFBox, it is good for reading and modifying an existing PDF file but createing a file from scratch using PDFBox can be a lot of work.