Issue related to annotations. When user resizes annotation with freetext we want to resize font size to keep text inside annotation borders. For that the following chunk of code is used:
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems like you’re attempting to adjust the font size dynamically when resizing a FreeText annotation in WebViewer, but you’re encountering an issue where text is getting wrapped or truncated. This can happen if the calculated font size doesn’t account for line height or the vertical space needed for the text.
Some things you can try:
Ensure that the calculated font size considers the height of the annotation, not just the width. This may involve checking the annotation’s height and adjusting the font size accordingly.
Use the switchToAutoFontSize method to automatically adjust the font size based on the annotation’s bounding box. This method may simplify your approach by handling font size adjustments automatically.
Consider the text’s line height and padding within the annotation, which might affect how text fits within the annotation’s borders.
After resizing, check the getCalculatedFontSize method to verify the font size and make further adjustments if necessary.