필드 스크립트 설정
Contents
[
Hide
]
필드 스크립트 설정
- 소스 PDF를
FormEditor파사드에 바인딩하세요. - 필드에 초기 JavaScript 작업을 추가하세요.
- 업데이트된 스크립트 텍스트로 바꾸세요.
- 업데이트된 문서를 저장하세요.
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();
}
}