ضبط سكريبت الحقل

ضبط سكريبت حقل

  1. اربط ملف PDF المصدر إلى واجهة FormEditor.
  2. أضف إجراء JavaScript أولي إلى الحقل.
  3. استبدله بنص البرنامج النصي المحدث.
  4. احفظ المستند المحدث.
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();
    }
}