Rename Form Fields
Contents
[
Hide
]
Use FormExamples.renameFormFields(...) to rename fields in an interactive PDF form.
public static void renameFormFields(Path inputFile, Path outputFile) {
Form form = new Form();
try {
form.bindPdf(inputFile.toString());
form.renameField("First Name", "NewFirstName");
form.renameField("Last Name", "NewLastName");
form.save(outputFile.toString());
} finally {
form.close();
}
}