Friday, May 30, 2014

Manipulating PDF document using iText library

There are several libraries that can be used to manipulate a PDF document like PDFBox, iText, PDFClows etc. I also have to do some PDF manipulation stuff and I decided to go with iText. I choose iText because it supports low level PDF manipulation, its community is very strong, lots of helping hands are available and it is also open source and available in both Java and C#.

iText allows you to create a PDF doument, add content in it, update content and save it. I have tried following basic features so far and found it really interesting:

  • With low level support one can add a text chunk, paragraph, phrase, link, chapter, section, image, set text color and other attributes into the document. 
  • You can also create a table/grid inside a PDF document and play with each cell of the table.
  • It is also easy to read an existing PDF document. You can retrieve existing information related to document and pages.
  • Using iText one can also fill up an empty PDF template.
  • It allows to set javascript in a PDF document to make a document interactive. Document can be also be navigated to a particular page. Creating bookmarks, annotations and triggering javascirpt from a button can also be done using iText.
  • Document can also be password encrypted to allow/disallow certain actions that can be done the document.
  • Whole PDF document can also be signed using a certificate to make the document secure.
There is also a book on how to play with PDFs using iText in ActionHe is the author of iText in Action and is very supportive on stackoverflow. I also have some questions regarding iText on stackoverflow on this link.

rizzz86