既存のPDFファイルのすべてのフィールドをフラット化する (facades)
Contents
[
Hide
]
Form クラスの flattenAllFields(..) メソッドを使用すると、PDFフォームのすべてのフィールドをフラット化することができます。まず、Form オブジェクトを作成し、ソースPDFファイルをバインドしてから、flattenAllFields(…) メソッドを呼び出し、最後に save(..) メソッドを使用して更新されたPDFを保存します。
次のコードスニペットは、PDFファイルのすべてのフィールドをフラット化する方法を示しています。
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"); |