Java PDF generating library

15,175

Solution 1

We are in the same boat at my job, and are moving to pdfbox. For what it's worth, generating real print quality PDFs (like, ones that get printed hardcopy by a print company) for office documents is somewhat non-trivial. In my experience, distiller does the best job. But PDFBox is certainly more straightforward if that will meet your print needs.

Solution 2

You can use below three Java libraries to create HTML+CSS template to makeup your PDF file. Flying-saucer + Freemarker + Itext

Flying-saucer:https://code.google.com/p/flying-saucer/

Freemarker: http://freemarker.org/

Itext 2.1.7: http://itextpdf.com/ (Please note this is the free version of iText in commercial projects.)

You can also Check this project which is using these three libraries:

https://github.com/xiang-lee/pdf-generator

Solution 3

Personally I have used Apache FOP supports several output formats. You might also be interested in JasperReports it supports pdf, html, excel and openoffice.

Solution 4

Apache PDFBox perhaps?

http://pdfbox.apache.org/

Solution 5

iText wasn't always under AGPL. You might consider using iText 2.7 or 4.2 which are under LGPL.

See also this question: What is latest version of itext that is not AGPL?

Share:
15,175
WelcomeTo
Author by

WelcomeTo

Updated on August 12, 2022

Comments

  • WelcomeTo
    WelcomeTo almost 2 years

    Which Java PDF library to use in commercial project? I need to generate a printable (and good if it will be editable, like .xls) report (it contains table, some text and report's total page count - this is because I can't use HTML( I can't calculate page count)). P.S. I can't use iText because it's licence don't allow to use free version of iText in commercial projects.

    Thanks.