iText Documentation

Welcome on the iText Documentation pages. On this site, you'll find all the information you need to get started with iText:

If you have comments or suggestions, please visit the contact page at itextpdf.com.

Writing documentation about a software project that is very alive and to which new functionality is added frequently, is a work that is constantly under construction. You can reward the work that is done on the documentation by buying the book about iText.

back to main page
Can I use iText to fill a Reader Enabled form?

Yes, but you have to take special care when you do so.

First let's have a look at how NOT to do it: FillEnabledFormBreakEnabling. Although this form is filled exactly as documented in the book on iText and in all other documentation, the result of doing it this way will lead to the following error message in Adobe Reader:

"This document contained certain rights to enable special features in Adobe Reader. The document has been changed since it was created and these rights are no longer valid. Please contact the author for the original version of this document."

This error message is very accurate: when a form is filled using iText; the content of the PDF is changed, and the digital signature is invalidated. Therefore the rights are no longer valid. There are two ways to deal with this problem:

Remove the Usage Rights

Either you remove the Usage Rights as is done in the example FillEnabledFormRemoveEnabling:

reader.removeUsageRights();
Preserve the Usage Rights

Or you don't change the structure of the existing PDF file, but instead create an update of the file as is done in the example FillEnabledForm:

PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(RESULT), '\0', true);

With the first solution, the end user will no longer be able to save the form locally. With the second solution, the Usage Rights will remain intact.

 
Copyright © 2008-2010 by 1T3XT BVBA
Hosted by openminds