Annotation's labels overlap issue

Which product are you using?
PDF.js Express Plus

PDF.js Express Version

Detailed description of issue
I am adding labels to the annotations (these can be manual as well as programmatic). Normally, the behavior is as expected, but when the length of the label is a little longer, the letters/numbers overlap each other. You may see it in the attached link to the screenshot.As you can see, last digit of the label is being overlapped.


Expected behaviour
I want the width of the labels to be adjusted dynamically no matter what the size(width) of the annotation is.

Does your issue happen with every document, or just one?
Every Document

Code snippet
const freeTextAnnotation: any = addFreeTextAnnotation(Annotations, annotateData, rotatedX1, rotatedY1, rotation, customData, width);
annotationManager.drawAnnotationsFromList([lastAnnotation, freeTextAnnotation]);
annotationManager.groupAnnotations(lastAnnotation, [freeTextAnnotation]);

const addFreeTextAnnotation = (Annotations: any, annotationData: any, x: any, y: any, rotation: any, customData: any, width: any = null) => {
if (! return;
const freeText = new Annotations.FreeTextAnnotation();
freeText.PageNumber = Number(;
freeText.CustomData = customData
freeText.NoMove = true;
freeText.NoResize = true;
// const textWidth = annotationData.doorId.length * ((16) / 3);
switch (rotation) {
case 0:
freeText.X = x;
freeText.Y = y - 10 + freeText.Y
// freeText.Width = textWidth;//35;
freeText.Height = 10;
case 90:
freeText.X = x - 10 + freeText.X;
freeText.Y = y - 10 + freeText.Y;
// freeText.Width = 10;
freeText.Height = 10;//35;
case 270:
freeText.X = x + width;
freeText.Y = y;
// freeText.Width = 10;
freeText.Height = 10;//35;
// Handle other rotation angles if necessary

Hello y19mridul,

Have you tried our autosizing types? Specifically FIXED_HEIGHT and FIXED_WIDTH

Best regards,