Flatten Interactive Forms

  • 2 minutes to read

This document explains interactive form flattening and provides information on how to flatten interactive forms using the PDF Document API component.

This document consists of the following sections.


A PDF document can contain interactive forms (AcroForms) with form fields (e.g., text fields, buttons, list boxes). You can edit an interactive form (e.g., click on the form field and change its value, or fill it out).


For more information about filling a form with data, see the How to: Fill an Interactive Form with Values example.

The PDF Document API component can flatten these form fields. The flattening process removes the form field interactive features, so the value entered or selected in the form field will be rendered like regular content (e.g., text, images, shapes, and so on).



The flattening process cannot be undone, so it is recommended that you save the flattened document under a different name.

You can flatten interactive forms in two ways.

  • Flattening an entire form
  • Flattening a form field by its name

The sections below detail each approach to flattening.

Flatten an Entire Form

To flatten an entire form, call the PdfDocumentProcessor.FlattenForm method. This method returns false if the document does not contain an interactive form to be flattened, otherwise it returns – true.

See the code snippet below.

using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {
     if (processor.FlattenForm())

Flatten a Specific Field by its Name

If you need to flatten specific fields, you can call the PdfDocumentProcessor.FlattenFormField method and pass the name of the field to it. This method returns false, if the form field was not found in the document; otherwise it returns - true.

Note that the PdfDocumentProcessor.FlattenFormField method flattens only a field whose name is known. Other form fields maintain their interactive features.

To obtain a list of form fields names, use the PdfDocumentProcessor.GetFormFieldNames method.