There are many open source and commercial libraries for creating and manipulating PDF documents in Java. Based on my experience with these libraries, I have shortlisted three of the open source Java PDF Libraries which aides Java developers in creating PDF documents and also in manipulating them.
1. Apache PDFBox
The Apache PDFBox supports the creation of new PDF documents as well as manipulation of existing PDF documents. The PDFBox which is published under Apache License v2 also has several command line utilities. Few other important features of this library are PDF to text extraction, merging of PDF documents, PDF encryption/decryption and creation of images from PDF.
2. iText PDF
iText is another cool Java PDF library which offers a rich set of features for the developers. It supports dynamic PDF generation and manipulation, thus making it a good choice for developers who are looking for offering PDF related features in their web applications. Following are the few other major features offered by this library,
- Generate dynamic documents from XML files or databases
- Add bookmarks, page numbers, watermarks, etc.
- Split, concatenate, and manipulate PDF pages
- Automate filling out of PDF forms
- Add digital signatures to a PDF file
This library is available in two editions, a free community edition, and a commercial edition.
3. PDF Clown
The PDF clown is another free and popular Java PDF library for creating, reading and editing PDF documents. Apart from the basic PDF creation and reading, following are some of the major functionalities offered by PDF Clown,
- PDF rasterizer helps in content rendering and printing
- Allows creating, reading and modifying bookmarks
- Allows to create, read and modify Acroform fields
- Supports content grouping into switchable layers
- advanced text extraction functionalities
If you have used any other Java PDF libraries and if you feel they are better than the ones mentioned above, do feel free to share with us.