设置字段限制

设置字段字符限制

  1. 将源 PDF 绑定到 FormEditor 对象。
  2. 调用 setFieldLimit(...) 用于目标字段和最大字符计数。
  3. 保存更新后的文档。
public static void setFieldLimit(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.setFieldLimit("First Name", 15);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}