ComboBox フィールドの作成
Contents
[
Hide
]
FormEditorExamples.createComboBoxField(...) を使用してコンボボックスを作成し、選択可能な項目を追加してください。
コンボ ボックス フィールドの作成
- ソース PDF を
FormEditorファサードにバインドしてください。 - デフォルト値と対象矩形を持つコンボボックスフィールドを追加してください。
- 選択可能なコンボボックス項目を追加してください。
- 更新された文書を保存してください。
public static void createComboBoxField(Path inputFile, Path outputFile) {
FormEditor editor = new FormEditor();
try {
editor.bindPdf(inputFile.toString());
editor.addField(FieldType.ComboBox, "combobox1", "Australia", 1, 230, 498, 350, 514);
editor.addListItem("combobox1", new String[] {"Australia", "Australia"});
editor.addListItem("combobox1", new String[] {"New Zealand", "New Zealand"});
editor.save(outputFile.toString());
} finally {
editor.close();
}
}