Copy Inner Field

Copy a field inside the same PDF

  1. Bind the source PDF to the FormEditor facade.
  2. Call copyInnerField(...) with the source field name, new field name, page, and coordinates.
  3. Save the updated document.
public static void copyInnerField(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.copyInnerField("First Name", "First Name Copy", 2, 200, 600);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}