TextBox 필드 만들기
Contents
[
Hide
]
PDF 양식에 텍스트 필드를 추가하려면 FormEditorExamples.createTextBoxField(...)를 사용하세요.
텍스트 상자 필드 만들기
- 소스 PDF를
FormEditor파사드에 바인딩하세요. FieldType.Text, 필드 이름, 기본값, 페이지 번호 및 직사각형을 사용하여 각 텍스트 필드를 추가하세요.- 업데이트된 문서를 저장하세요.
public static void createTextBoxField(Path inputFile, Path outputFile) {
FormEditor editor = new FormEditor();
try {
editor.bindPdf(inputFile.toString());
editor.addField(FieldType.Text, "first_name", "Alexander", 1, 50, 570, 150, 590);
editor.addField(FieldType.Text, "last_name", "Smith", 1, 235, 570, 330, 590);
editor.save(outputFile.toString());
} finally {
editor.close();
}
}