Set Field Alignment

Set horizontal field alignment

  1. Bind the source PDF to the FormEditor facade.
  2. Call setFieldAlignment(...) for the target field and desired alignment constant.
  3. Save the updated document.
public static void setFieldAlignment(Path inputFile, Path outputFile) {
    FormEditor editor = new FormEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.setFieldAlignment("First Name", FormFieldFacade.ALIGN_CENTER);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}