إنشاء حقل ComboBox

استخدام FormEditorExamples.createComboBoxField(...) لإنشاء مربع اختيار وإضافة عناصر قابلة للتحديد.

إنشاء حقل صندوق اختيار

  1. اربط ملف PDF المصدر إلى واجهة FormEditor.
  2. أضف حقل مربع السرد مع القيمة الافتراضية والمستطيل الهدف.
  3. أضف العناصر القابلة للتحديد لمربع السرد.
  4. احفظ المستند المحدث.
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();
    }
}