Menambahkan aksi dokumen
Contents
[
Hide
]
Menambahkan aksi document-open
- Ikat PDF sumber ke fasad
PdfContentEditor. - Panggil
addDocumentAdditionalAction(...)denganDOCUMENT_OPENperistiwa dan teks aksi JavaScript. - Simpan dokumen PDF yang diperbarui.
public static void addDocumentAction(Path inputFile, Path outputFile) {
PdfContentEditor editor = new PdfContentEditor();
try {
editor.bindPdf(inputFile.toString());
editor.addDocumentAdditionalAction(PdfContentEditor.DOCUMENT_OPEN, "app.alert('Document opened with PdfContentEditor action');");
editor.save(outputFile.toString());
} finally {
editor.close();
}
}