# How to get selection draw cords (x,y)

**URL:** <https://pdfjs.community/t/how-to-get-selection-draw-cords-x-y/2613>\
**Category:** Technical Support\
**Created:** [May 29, 2023, 7:51am UTC](https://pdfjs.community/t/how-to-get-selection-draw-cords-x-y/2613 "2023-05-29T07:51:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel-wi](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@daniel-wi](https://pdfjs.community/u/daniel-wi)\
**Post date:** [May 29, 2023, 7:51am UTC](https://pdfjs.community/t/how-to-get-selection-draw-cords-x-y/2613/1 "2023-05-29T07:51:12Z")

</div>

Hi,

I didn’t understand which event is referring to the ‘selection’ tool.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/d/d6bbd998de57569fff235797301e8016aa680866.png)

I need to get the cords and understand if it know give me relative points in scale (zooming) or I need to manually calculate the original X,Y?

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [May 29, 2023, 8:48pm UTC](https://pdfjs.community/t/how-to-get-selection-draw-cords-x-y/2613/3 "2023-05-29T20:48:15Z")

</div>

Hi daniel-wi,

The selection tool should be using X and Y coordinates in the browser, you can use the windowToPage() API to convert from window to page coordinates.

Best regards,  
Tyler
