Flatten all Fields in existing PDF File (facades)

Contents
[ ]

flattenAllFields(..) method of Form class allows you to flatten all the fields of the PDF form. You first need to create Form object, bind source PDF file and then call the flattenAllFields(…) method and finally save the updated PDF using save(..) method.

The following code snippet shows you how to flatten all the fields of the PDF file.

// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java
// open document
Form pdfForm = new Form();
// bind source PDF file
pdfForm.bindPdf("input.pdf");
// flatten fields
pdfForm.flattenAllFields();
// save output
pdfForm.save("output.pdf");