Create CheckBox Field
Contents
[
Hide
]
Use FormEditorExamples.createCheckBoxField(...) to add a check box field to a PDF form.
Create a check box field
- Bind the source PDF to the
FormEditorfacade. - Add the check box field with
FieldType.CheckBox, the field name, caption, page, and rectangle. - Save the updated document.
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();
}
}