Flatten all Fields in existing PDF File (facades)
Contents
[
Hide
]
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |