Set Field Alignment
Contents
[
Hide
]
Set horizontal field alignment
- Bind the source PDF to the
FormEditorfacade. - Call
setFieldAlignment(...)for the target field and desired alignment constant. - 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();
}
}