# Custom Annotation drop location on different Resolution

**URL:** <https://pdfjs.community/t/custom-annotation-drop-location-on-different-resolution/642>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [March 18, 2021, 10:21am UTC](https://pdfjs.community/t/custom-annotation-drop-location-on-different-resolution/642 "2021-03-18T10:21:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rizwanfancy](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rizwanfancy](https://pdfjs.community/u/rizwanfancy)\
**Post date:** [March 18, 2021, 10:21am UTC](https://pdfjs.community/t/custom-annotation-drop-location-on-different-resolution/642/1 "2021-03-18T10:21:02Z")

</div>

**PDF.js Express Version**

1. Build: “Ni8yOS8yMDIwfDZhZDkzMGE=”
2. Core version: “6.3.4”
3. Full API: false
4. UI version: “6.3.3”
5. WebViewer Server: false

**Detailed description of issue**  
I’ve showing PDFJs into Modal Component where we will set the our Custom annotation controls to our Pdf document but the problem is that when we check on different resolution its drop point location have changed.

**Expected behaviour**  
Drop annotation point should be the same.

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

**Code snippet**  
dropPoint ={};  
instance.iframeWindow.document.body.ondrop = (e) =\> {  
const scrollElement = instance.docViewer.getScrollViewElement();  
const scrollLeft = scrollElement.scrollLeft || 0;  
const scrollTop = scrollElement.scrollTop || 0;  
this.dropPoint = { x: e.pageX + scrollLeft, y: e.pageY + scrollTop };

```
     this.addanotation(instance,this.dropPoint.x,this.dropPoint.y,customData);
      e.preventDefault();

      return false;

```

addanotation(viewer,X,Y,Data)  
{  
let point = this.dropPoint || { x: layerX, y: layerY };  
const { Annotations, docViewer, annotManager } = instanceRef;  
const pageNumber = docViewer.getCurrentPage();  
const freeText = new Annotations.FreeTextAnnotation();  
freeText.PageNumber = pageNumber;  
freeText.X = point.x;  
freeText.Y = point.y;

annotManager.deselectAllAnnotations();  
annotManager.addAnnotation(freeText);  
annotManager.redrawAnnotation(freeText);  
annotManager.selectAnnotation(freeText);  
}

---

_[View the full topic](https://pdfjs.community/t/custom-annotation-drop-location-on-different-resolution/642)._
