Some test text!

Form flattening


About form flattening

To flatten form fields in a PDF document.

PDFDoc doc = new PDFDoc(filename);

// flatten only form annotations

linkAbout form flattening

Form flattening refers to the operation that changes active form fields into a static area that is part of the PDF document, just like other text and images in the document. A completely flattened PDF form does not have any widget annotations or interactive fields.

Using the Field.Flatten() or Page.FlattenField() methods, it is possible to merge individual field appearances with the page content. PDFTron SDK also allows you to flatten all forms in the document in a single function call, with PDFDoc.FlattenAnnotations(true). (The true argument instructs PDFTron SDK to only flatten fields; were this method passed false, or no argument, it would flatten all annotations as well as all fields.)

Note that it is not possible to undo the Field.Flatten() operation. An alternative approach, one that can be programmatically reversed, would be to set the field as read only using the Field.SetFlag(Field.e_read_only, true) method.

Get the answers you need: Support


About form flattening