PDF.js Express Version
7.3.0
Detailed description of issue
When I create an annotation programmatically it inherits the rotation of the document, when creating an annotation through the UI it appears right side up which is what I would like.
Expected behaviour
Create the annotation so the top is the top and not rotated with the document
Does your issue happen with every document, or just one?
All
Code snippet
Here is how I am creating the annotation
async function AddButton(text, id, text_colour, fill_colour, width, height, x, y, font_size, page_num) {
const centerPageCoordinates = getCenter();
const freeText = new Annotations.FreeTextAnnotation();
if (page_num == -1) {
page_num = docViewer.getCurrentPage();
x = centerPageCoordinates.x - (width / 2);
y = centerPageCoordinates.y - (height / 2);
}
freeText.PageNumber = page_num;
freeText.X = x;
freeText.Y = y;
freeText.Width = width;
freeText.Height = height;
freeText.setPadding(new Annotations.Rect(0, 0, 0, 0));
freeText.setContents(text);
freeText.TextColor = new Annotations.Color(text_colour);
freeText.FillColor = new Annotations.Color(fill_colour);
freeText.TextAlign = 'center';
freeText.FontSize = font_size;
freeText.NoRotate = true;
freeText.NoResize = true;
freeText.MaintainAspectRatio = true;
freeText.ToolName = '{{' + id + '}}';
freeText.LockedContents = true;
annotManager.deselectAnnotations(annotManager.getAnnotationsList());
annotManager.addAnnotation(freeText);
annotManager.redrawAnnotation(freeText);
//annotManager.bringToFront(freeText);
}