テキストボックスフィールドの作成
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();
}
}