필드 스크립트 설정

필드 스크립트 설정

  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();
    }
}