Ajouter un élément de liste

Ajouter un élément à un champ de liste

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

  2. Appelez addListItem(...) pour le champ cible et la nouvelle paire affichage/valeur.

  3. Enregistrez le document mis à jour.

public static void addListItem(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.addListItem("Country", new String[] {"New Zealand", "New Zealand"});
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}