创建复选框字段
Contents
[
Hide
]
使用 FormEditorExamples.createCheckBoxField(...) 向 PDF 表单添加复选框字段。
创建复选框字段
- 将源 PDF 绑定到
FormEditor立面。 - 添加复选框字段
FieldType.CheckBox, 字段名称、标题、页面和矩形。 - 保存更新后的文档。
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();
}
}