Disable extended features with iTextSharp

Fill out the form in append mode by using the PdfStamper constractor overload

// PdfStamper, which will create
var stamper = new PdfStamper(pdfReader, fileStream, '\0', true);

The links here are dead as the iTextPdf web site has been completely revamped. But the answer can be understood without those links, too.

The iText Keyword: Reader enabled PDFs points to the following information:

Submitted by Bruno Lowagie on Fri, 12/31/2010 - 16:37

After filling out my form, my PDF shows the following message: This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document. How do I avoid this message?

The creator of the form made the document Reader enabled. Reader enabling can only be done using Adobe software. You can avoid this message in two ways:

  • Remove the usage rights. This will result in a form that is no longer Reader enabled. For instance: if the creator of the document allowed that the filled out form could be saved locally, this will no longer be possible after removing the usage rights.
  • Fill out the form in append mode. This will result in a bigger file size, but Reader enabling will be preserved.

It also points to the sample ReaderEnabledForm.java (the C#/iTextSharp equivalent of which is ReaderEnabledForm.cs) which shows how to do either.

In your case this amounts to calling

pdfReader.RemoveUsageRights();

right after creating the PdfReader and before creating the PdfStamper.

/**
 * Removes any usage rights that this PDF may have. Only Adobe can grant usage rights
 * and any PDF modification with iText will invalidate them. Invalidated usage rights may
 * confuse Acrobat and it's advisabe to remove them altogether.
 */
public void RemoveUsageRights()

Tags:

C#

Itextsharp