ImageGear v26.5 - Updated
Developer Guide / How to Work with ... / PDF / How to... / Work with PDF Forms / Flatten Form Fields
In This Topic
    Flatten Form Fields
    In This Topic

    ImageGear 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.

    See the FlattenPDFFormFields sample for an example of how to flatten the fields in a PDF form.

    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.