Объединение всех полей в существующем PDF-файле (фасады)
Contents
[
Hide
]
Метод flattenAllFields(..) класса Form позволяет объединить все поля формы PDF. Сначала вам нужно создать объект Form, привязать исходный PDF-файл, затем вызвать метод flattenAllFields(…) и, наконец, сохранить обновленный PDF, используя метод save(..).
Следующий фрагмент кода показывает, как объединить все поля PDF-файла.
This file contains 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"); |