PdfTextAlignment
12 Sep 20251 minute to read
Public Enum to define text alignment of text box field.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Access text box field
let field: PdfTextBoxField = document.form.fieldAt(0) as PdfTextBoxField;
// Sets the text alignment of form field as center
field.textAlignment = PdfTextAlignment.center;
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
center- Specifies the type ofcenter. -
justify- Specifies the type ofjustify. -
left- Specifies the type ofleft. -
right- Specifies the type ofright.