إنشاء حقل TextBox

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

إنشاء حقول TextBox

  1. اربط ملف PDF المصدر إلى واجهة FormEditor.
  2. أضف كل حقل نص مع FieldType.Text، اسم الحقل، القيمة الافتراضية، رقم الصفحة، والمستطيل.
  3. احفظ المستند المحدث.
public static void createTextBoxField(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.addField(FieldType.Text, "first_name", "Alexander", 1, 50, 570, 150, 590);
        editor.addField(FieldType.Text, "last_name", "Smith", 1, 235, 570, 330, 590);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}