PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Form flattening refers to the process of converting editable form fields into non-editable, static images, or pure text. When flattening form fields, all editable elements in the entire document (including annotations and forms) undergo flattening. Therefore, form flattening is also referred to as document flattening.
This example shows how to flatten forms:
CPDFDocument document = new CPDFDocument();
document.open(pdfPath);
document.flattenAllPages(CPDFPage.PDFFlattenOption.FLAT_NORMALDISPLAY);
document.save("savePath", isRemoveSecurity);What is Document Flattening?
Document flattening refers to the process of converting editable elements, such as annotations, form fields, or layers, in a PDF document into non-editable, static images, or pure text. The purpose of this process is to lock the final state of the document, eliminating editable elements.
Document flattening is typically applied in the following contexts: