Texts are not aligned inside free text annotations

Product: Apryse PDFTron
Product Version: 10.2.3

I want the texts in the FreeTextAnnotations aligned at the bottom of the box.
I found a property in the SDK for the same. Shown below.

However, the bottom align still leave a large gap between the text and the bottom border of the box. Which is similar to the center alignment. Here is a screenshot.


When I double click the annotation to edit the text, the text actually comes down to the bottom of the box. But it does not stay that way when editing is finished and focus is shifted to another annotation.

Any help will be appreciated.


Hello Subhra,

I believe this is happening because of padding between the border and text. If you create a larger free text annotation and set the vertical alignment to bottom, you will notice a bigger difference.

Best Regards,

Hey Darian,

I am using the following function to set the padding of the box to zero.

elem.setPadding(new instance.Core.Math.Rect(0, 0, 0, 0));

Where “elem” is a freetext annotation.
But I still see the padding between the box and the text. How do I make it truly zero?