إنشاء حقل CheckBox

استخدام FormEditorExamples.createCheckBoxField(...) لإضافة حقل خانة اختيار إلى نموذج PDF.

إنشاء حقل مربع اختيار

  1. اربط ملف PDF المصدر إلى واجهة FormEditor.
  2. أضف حقل مربع الاختيار مع FieldType.CheckBox، اسم الحقل، التسمية، الصفحة، والمستطيل.
  3. احفظ المستند المُحدَّث.
public static void createCheckBoxField(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.addField(FieldType.CheckBox, "checkbox1", "Check Box 1", 1, 240, 498, 256, 514);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}