Closed dr-matt closed 2 months ago
Hi @dr-matt ,
I'm afraid such functionality is not provided in borb
at this point in time.
You can consult the PDF specification (a copy of which can be found in the repository) to see what the options are.
In the best case scenario, there is some kind of flag you can set to indicate the text justification. In which case you can simply treat the TextField
objects as a dictionary and set the flag.
In the worst case, you need to calculate the position of text yourself (by calculating how wide the text is and having the width of the bounding box).
Kind regards, Joris Schellekens
@jorisschellekens thank you for the information and for a great library. Cheers!
Setting
horizontal_alignment=Alignment.CENTERED
of aTextField
centers the field itself within the layout, but when the field is filled, the text inside it defaults to left-aligned. Is there a way to center the filled text within theTextField
, similar totext_alignment
in theParagraph
object?