Mengatur skrip Field

Mengatur skrip bidang

  1. Ikat PDF sumber ke fasad FormEditor.
  2. Tambahkan aksi JavaScript awal ke bidang.
  3. Ganti dengan teks skrip yang diperbarui.
  4. Simpan dokumen yang diperbarui.
public static void setFieldScript(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.addFieldScript("Script_Demo_Button", "app.alert('Script 1 has been executed');");
        editor.setFieldScript("Script_Demo_Button", "app.alert('Script 2 has been executed');");
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}