Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

There were questions on that but not recently and technology must have gone ahead since then.

Requirements:

  • generating pdf documents based on predefined template (I can use either pdf forms or xsl-fo)
  • being able to fill textual data
  • being able to fill graphical data (generated bar codes)
  • being able to alter pdf template in production environment without patching (recompiling)
  • generating pdf file to be saved in the database (as blob) and/or printed
  • open source/free

The options assumed are iText, PDFBox, FOP, anything else? What are recommendations based on the requirements above?

like image 577
topchef Avatar asked Jul 08 '11 14:07

topchef


People also ask

Which is better iText or PDFBox?

One major difference is that PDFBox always processes text glyph by glyph while iText normally processes it chunk (i.e. single string parameter of text drawing operation) by chunk; that reduces the required resources in iText quite a lot.

Is PDFBox free for commercial use?

Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative ...

Is Apache PDFBox open source?

Apache PDFBox is an open source pure-Java library that can be used to create, render, print, split, merge, alter, verify and extract text and meta-data of PDF files.


2 Answers

  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.

like image 84
home Avatar answered Sep 17 '22 15:09

home


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.

like image 25
Brian Hoover Avatar answered Sep 18 '22 15:09

Brian Hoover