Set Field Appearance

Set field appearance flags

  1. Bind the source PDF to the FormEditor facade.
  2. Call setFieldAppearance(...) for the target field and chosen annotation flag.
  3. Save the updated document.
public static void setFieldAppearance(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.setFieldAppearance("First Name", AnnotationFlags.Hidden);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}