ListBox フィールドの作成

FormEditorExamples.createListBoxField(...) を使用して、事前定義された項目を持つリストボックスを作成してください。

リストボックス フィールドの作成

  1. ソース PDF を FormEditor ファサードにバインドしてください。
  2. 利用可能なリスト項目を setItems(...) で定義してください。
  3. デフォルト値と矩形を指定してリストボックスフィールドを追加してください。
  4. 更新されたドキュメントを保存してください。
public static void createListBoxField(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.setItems(new String[] {"Australia", "New Zealand", "Malaysia"});
        editor.addField(FieldType.ListBox, "listbox1", "Australia", 1, 230, 398, 350, 514);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}