重命名字段

Contents
[ ]

重命名字段

  1. 将源 PDF 绑定到 FormEditor 对象。
  2. 调用 renameField(...) 使用当前字段名称和新字段名称。
  3. 保存更新后的文档。
public static void renameField(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.renameField("City", "Town");
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}