# Can we get width and height of canvas that we have our pdf in?

**URL:** <https://pdfjs.community/t/can-we-get-width-and-height-of-canvas-that-we-have-our-pdf-in/308>\
**Category:** Technical Support\
**Created:** [September 30, 2020, 12:54pm UTC](https://pdfjs.community/t/can-we-get-width-and-height-of-canvas-that-we-have-our-pdf-in/308 "2020-09-30T12:54:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![himani.sharma](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@himani.sharma](https://pdfjs.community/u/himani.sharma)\
**Post date:** [September 30, 2020, 12:54pm UTC](https://pdfjs.community/t/can-we-get-width-and-height-of-canvas-that-we-have-our-pdf-in/308/1 "2020-09-30T12:54:40Z")

</div>

**PDF.js Express Version**

**Detailed description of issue**  
Need to get width and height of canvas so that we can can the annotation values of coordinates as a percentage of canvas dimensions?  
**Expected behaviour**  
{Provide a screenshot or description of the expected behaviour}

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
{Provide a relevant code snippet}

---

<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:** [September 30, 2020, 2:28pm UTC](https://pdfjs.community/t/can-we-get-width-and-height-of-canvas-that-we-have-our-pdf-in/308/2 "2020-09-30T14:28:39Z")

</div>

Hey there!

If you’re looking to just get the absolute size in pixel values, you can just select the `#pageContainer1` div right out of the dom.

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

For the second page you would select `#pageContainer2` etc.

Hopefully this helps!  
Thanks,  
Logan
