إنشاء حقل ListBox
Contents
[
Hide
]
استخدام FormEditorExamples.createListBoxField(...) لإنشاء صندوق قائمة بعناصر محددة مسبقًا.
إنشاء حقل ListBox
- اربط ملف PDF المصدر بال واجهة
FormEditor. - حدّد عناصر القائمة المتاحة باستخدام
setItems(...). - أضف حقل صندوق القائمة مع قيمته الافتراضية والمستطيل.
- احفظ المستند المحدث.
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();
}
}