How to get plan(PDF) detail as annotations differ in size(thickness) when same annotation drawn in both plans

PDF.js Express Version
7.3.1

Detailed description of issue
Here in the below image, you can see that purple colored annotation with StrokeThickness = 4:
image
In this below image, It has the same purple colored annotation with StrokeThickness = 4:

I guess its with the plan’s(pdf) pixels or density. First plan is quite a big plan than second one. Also, note that here both plans have same scale set.

How to solve this issue. Is it possible to find a ratio and make thickness dynamic?

Expected behaviour
Annotations should be visible in same size irrespective of plan’s density.

Does your issue happen with every document, or just one?
Plans with high pixel density like first drawing.

Link to document
First drawing.
Multipurpose hall - 1st Floor.pdf (160.4 KB)
Second drawing, respectively.
Single image.pdf (191.9 KB)

Code snippet

Instance.annotManager.setAnnotationStyles(annotation, annotation.StrokeThickness = 4);

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hey there!

This actually has to do with the zoom level when viewing the document. When you load a big document like your first example, we need to zoom way out in order to display the entire document. This means that annotations also appear zoomed out.

You have a few options here:

Set the zoom level to 100% by default:

instance.docViewer.on('documentLoaded', () => {
    instance.docViewer.zoomTo(1)
  })

Or, get the zoom level and adjust the stroke thickness accordingly:

  instance.docViewer.on('documentLoaded', () => {
    instance.docViewer.getZoom()
  })

  instance.docViewer.on('zoomUpdated', () => {
    instance.docViewer.getZoom()
  })

Thanks!
Logan