Copier un champ dans le même PDF

Copier un champ dans le même PDF

  1. Liez le PDF source à la façade FormEditor.

  2. Appelez copyInnerField(...) avec le nom du champ source, le nouveau nom du champ, la page et les coordonnées.

  3. Enregistrez le document mis à jour.

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