ImageGear for .NET does not support modification of forms in PDF documents containing XFA. Please see
XFA Support for more information.
Flattening form fields refers to the process of converting user-interactive form fields into static page content. After flattening a field, the interactive representation is removed from the document.
The FlattenFormField call flattens the specified field into the page, while FlattenFormFields repeats this process for each field in the PDF.
Each method accepts a boolean indicating whether only fields that are set to appear during printing should be flattened, while the others are removed. This is particularly useful for interactive fields like buttons, that make no sense on a printed piece of paper. See the FlattenFormField and FlattenFormsFields pages for more information on the parameters.
The following code shows examples of how to flatten form fields:
PDF support needs to be initialized first for this snippet to work. To get familiar with initializing IGNET, initializing PDF support, loading a PDF, saving a PDF, and terminating PDF support, try any one of the
tutorials.
Flattening Notes
- The visibility of each of the field depends on whether the HIDDEN, PRINT or NOVIEW flags are set in the field’s widget annotations. These will be respected during flattening.
- An annotation with a HIDDEN flag will never appear on the page.
- An annotation with a NOVIEW flag will appear on the page only if “forPrinter” is specified in the flatten method calls.
- An annotation without a PRINT flag will appear on the page only if “forPrinter” is not specified.
- Flattening a signature field removes all visual information.
- FlattenFormFields also removes any XFA data, if present. The use of FlattenFormField is not supported on documents containing XFA and may lead to inconsistencies in the document. See XFA Support for more information.