WebViewer Version: 8.9.0
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? Yes
Please give a brief summary of your issue:
(Think of this as an email subject)
Autosize properties are not working when creating a freetext annotation programatically
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I’m creating and inserting a freetext annotation using this code
const freeText = new this.annotations.FreeTextAnnotation();
freeText.setAutoSizeType('auto');
freeText.X = x;
freeText.Y = y;
freeText.PageNumber = page;
// freeText.Width = width;
// freeText.Height = height;
freeText.Subject = subject;
freeText.TextAlign = 'center';
freeText.StrokeThickness = 0;
freeText.IsHoverable = true;
freeText.TextVerticalAlign = 'center';
freeText.TextColor = new this.annotations.Color(0, 0, 0);
freeText.setContents(contents);
freeText.setPadding(new this.annotations.Rect(0, 0, 0, 0))
freeText.FontSize = '12pt';
freeText.setCustomData('uniqueId', this.uniqueId);
that.annotationManager.addAnnotation(annotation, {autoFocus: false});
that.annotationManager.redrawAnnotation(annotation);
that.annotationManager.deselectAllAnnotations()
that.annotationManager.selectAnnotation(annotation)
this code generates the annotation just fine but width and height are not adjusted to content and i get this
if i uncomment height and width properties it looks like this
this one looks fine but if i change font size it doesn’t change annotation dimensions and that’s my issue, any advice to make this work will be appreciated