フィールド名の変更

フィールドの名前の変更

  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();
    }
}