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

**URL:** <https://pdfjs.community/t/how-to-get-plan-pdf-detail-as-annotations-differ-in-size-thickness-when-same-annotation-drawn-in-both-plans/752>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [May 6, 2021, 6:40am UTC](https://pdfjs.community/t/how-to-get-plan-pdf-detail-as-annotations-differ-in-size-thickness-when-same-annotation-drawn-in-both-plans/752 "2021-05-06T06:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.patil](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kiran.patil](https://pdfjs.community/u/kiran.patil)\
**Post date:** [May 6, 2021, 6:40am UTC](https://pdfjs.community/t/how-to-get-plan-pdf-detail-as-annotations-differ-in-size-thickness-when-same-annotation-drawn-in-both-plans/752/1 "2021-05-06T06:40:46Z")

</div>

**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](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/a98f0f914094e75ae12533ffc7c03f212c456f98.png)  
In this below image, It has the same purple colored annotation with **StrokeThickness = 4** :

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/8bc8ada181e9271284e134166cc4a1723ad44516.png)

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](https://pdfjs.community/uploads/short-url/vw2pknuzFw5LKroYPK10gAklnFM.pdf) (160.4 KB)  
Second drawing, **respectively**.  
[Single image.pdf](https://pdfjs.community/uploads/short-url/1BzRii8Ge3LcbbBMxNoY1OUY0UP.pdf) (191.9 KB)

**Code snippet**

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [May 6, 2021, 6:40am UTC](https://pdfjs.community/t/how-to-get-plan-pdf-detail-as-annotations-differ-in-size-thickness-when-same-annotation-drawn-in-both-plans/752/2 "2021-05-06T06:40:52Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

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

Guides:
- [Create custom annotation styles](https://pdfjs.express/documentation/annotation/customizing-default-annotation-styles)
- [XFDF format - In PDF.js Express Web Viewer](https://pdfjs.express/documentation/annotation/xfdf#in-pdf.js-express-web-viewer)
- [Hiding annotations in WebViewer notes panel](https://pdfjs.express/documentation/ui-customization/ui-customization-notes-panel)

APIs:
- [CoreControls.AnnotationManager - updateAnnotation(annotation)](https://pdfjs.express/api/CoreControls.AnnotationManager.html#updateAnnotation__anchor)
- [Annotations.TextWidgetAnnotation - resourcesLoaded()](https://pdfjs.express/api/Annotations.TextWidgetAnnotation.html#resourcesLoaded__anchor)
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)

Forums:
- [How to change annotation styles for area and line tool like Stripped color and dashes](https://pdfjs.community/t/how-to-change-annotation-styles-for-area-and-line-tool-like-stripped-color-and-dashes/501/1)
- [Value’s not getting proper during co-ordinates calculation](https://pdfjs.community/t/values-not-getting-proper-during-co-ordinates-calculation/107/1)
- [XFDFs not loaded completely when imported](https://pdfjs.community/t/xfdfs-not-loaded-completely-when-imported/86/3)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [May 11, 2021, 3:56pm UTC](https://pdfjs.community/t/how-to-get-plan-pdf-detail-as-annotations-differ-in-size-thickness-when-same-annotation-drawn-in-both-plans/752/3 "2021-05-11T15:56:12Z")

</div>

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:

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

```

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

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

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

```

Thanks!  
Logan
