Java PDF Libraries Selection

By | 9月 17, 2015

I have a task to choose a Java PDF libraries for PDF generation.

Project requirements

1. Can write table directly into PDF. So that the table is scalable compared to a table image.

2. Support for writing SVG image into PDF.

The lib I finally choose is iText

Finally I choose iText. Because iText has a lot of documentation and tutorial. The book “ITEXT IN ACTION – SECOND EDITION” is a an excellent book, however it’s not free. But there’s collection of “the best Q&A in 250 pages”, which helps you find fast and creative solutions for any iText project. ITEXT is not commercial free. The fee is $1325 / 1025€ for a pack of 10 desktops. ITEXT Desktop License detail.

At the first, I use apache PDFBox, which is commercial free. But I found that PDFBox cannot write table into PDF directly. If it’s for this reason, I wouldn’t choose ITEXT.

Write SVG into PDF is not supported by any PDF libraries. We should use a third part library to handle SVG image. What I use is Batik. Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation. Batik official website.

Different PDF libraries comparison

Lib Name License Price Support Language Write Table
iText COMMERCIAL LICENSING /  AGPL

$1325 / 1025€ for a pack of 10 desktops

Java, .Net,
Android, GAE

Y
PDFBox BSD License Free Java N
PDF Clown GPL Free Java, .Net Y
jPod BSD License Free Java unknown
PDFJet BSD License

$295 US – Named Developer License
$595 US – Transferable Developer License

Java, .NET Y
PDF Renderer LGPL Depends Java  
gnujpdf LGPL Free Java N
FOP Apache Software License Free Java From XSL
JFreeReport LGPL      
PJX GPL   JAVA  
Jpedal GPL      
ICEpdf Apache Software License      
Prince   US$495 JAVA, PHP, .NET  

Resources