iText is a Free/Open Source Software library that can be used for the creation and manipulation of PDF documents ‘on-the-fly’ (meaning from Java Source Code, not using a DeskTop application); iText can be used to:
PDF is the file format of choice whenever a document must preserve its structure and layout. Developers looking to enhance web- and other applications with dynamic PDF document generation and/or manipulation can use iText to create/manipulate PDF documents on-the-fly in one or more of the following situations:
The most authoritive resource on iText is the book I wrote, but meanwhile new features have been added to the library, and I also have some new examples I want to share with you. The tutorial iText by Example could have been a good place to add this extra information, but I opted for a Wiki because this way other iText users can get involved: if you register, you can add your own examples and your own links to the site. Note that I have some bad experiences with user-generated content on the book support site (the feedback forms are infested with SPAM). That’s why only registered people are allowed to edit pages (and as with itext.ugent.be every user action is monitored).
I wrote these examples using the Eclipse Development Platform. You can compile and run the examples in different IDEs or even manually, but then you’ll have to make sure you have all the right jars in your CLASSPATH, also you need to make sure you’re running the JVM with the correct working directory. Otherwise you might not have access to the resources or the database.
Before you start, please read the pages on the environment and the database for more info. All the example code, jars, resources,... can be downloaded from http://itext.ugent.be/wiki/examples/. Basically you can start compiling and executing these examples if you have sufficient knowledge of Java, and if you keep the directory structure intact. (You’ll probably need all the files!)
These are the examples that are available on this Wiki for the moment:
The book iText in Action was presented to the public at JavaPolis. As I explain in my interview with Ted Neward I made a completely new set of examples for this presentation, subtitled Dr. iText, or: How I Learned to Stop Worrying and Love PDF. In this presentation, Paulo Soares (the other developer of iText) and I gave a one hour overview of the basic functionality of iText. In this first series of examples, you’ll learn how to reproduce the applications that were shown at JavaPolis.
In the PDF Reference 1.7 a very interesting new feature is introduced: portable collections. I briefly discuss the possibilities of portable collections, and I demonstrate the functionality using two examples:
The first example is the most valuable if you want to start using portable collections in your own applications; the second example is meant to inspire you ;)
I wrote some articles in the past that dealt with forms. For instance: ICT for ECTS about forms that can be used for implementing the European Credit Transfer System, and the Belgian eID and PDF about forms and digital signatures. The examples that come with these articles date from before iText 2.0. Since iText 2.0, a class PdfSmartCopy was introduced. It’s an ideal class if you want to fill out AcroForms (used as a template) in batch with one large PDF (containing all the filled in forms) as a result. This is what’s done in the learningagreement example.