Flatten PDF annotations on iOS

To flatten annotations in a PDF document.

1PTPDFDoc *doc = [[PTPDFDoc alloc] initWithFilepath: filename];
2
3// flatten all annotations
4[doc FlattenAnnotations];

PDF interactive forms (AcroForms)
Full sample code which illustrates some basic PDFNet capabilities related to interactive forms (also known as AcroForms) and annotation flattening.

About annotation flattening

Annotation or form flattening refers to the operation that changes annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document, just like the other text and images in the document.

Using the Annotation.Flatten(page), it is possible to merge individual annotations with the page content. Apryse SDK also allows you to flatten all forms in the document in a single function call, with PDFDoc.FlattenAnnotations().

Widget annotations share a relationship with forms because the display of a form field is a widget annotation. The process of flattening annotations therefore can flatten forms as well. By flattening and merging existing annotation appearances with page content, the original annotations are deleted from the PDF pages.

Note that it is not possible to undo the flatten operation. An alternative approach to annotation or form flattening is to set the annotation to e_read_only. The e_read_only flag on the annotation enables this modification.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales