Удаление вложений
Contents
[
Hide
]
Удаление всех вложений
- Привяжите исходный PDF к фасаду
PdfContentEditor. - Вызовите
deleteAttachments(), чтобы удалить каждое встроенное вложение. - Сохраните обновлённый PDF‑документ.
public static void removeAttachments(Path inputFile, Path outputFile) {
PdfContentEditor editor = new PdfContentEditor();
try {
editor.bindPdf(inputFile.toString());
editor.deleteAttachments();
editor.save(outputFile.toString());
} finally {
editor.close();
}
}