# Manage zoom in mobile using pinch

**URL:** <https://pdfjs.community/t/manage-zoom-in-mobile-using-pinch/1523>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [March 30, 2022, 9:40am UTC](https://pdfjs.community/t/manage-zoom-in-mobile-using-pinch/1523 "2022-03-30T09:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luis.perezsanchez](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/luis.perezsanchez/32/726_2.png) [@luis.perezsanchez](https://pdfjs.community/u/luis.perezsanchez)\
**Post date:** [March 30, 2022, 9:40am UTC](https://pdfjs.community/t/manage-zoom-in-mobile-using-pinch/1523/1 "2022-03-30T09:40:57Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.x.x

**Detailed description of issue**  
I cannot find how to manage the zoom events produced by pinching in mobile.  
I have read that it should work out of the box. But it’s not my case.

I have tried on Android and IOS and the result is the same.

Our PDFs have to be compiled so there are forms present, I don’t know if this can cause a problem.

Do you have an example or snippet?

---

<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:** [March 30, 2022, 9:41am UTC](https://pdfjs.community/t/manage-zoom-in-mobile-using-pinch/1523/3 "2022-03-30T09:41:03Z")

</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:
- [Understand coordinates in PDF.js Express - PDF page coordinates](https://pdfjs.express/documentation/viewer/coordinates.8#pdf-page-coordinates)
- [Create rectangle annotations in PDF.js Express - Other examples](https://pdfjs.express/documentation/annotation/create-annotation-rectangle#other-examples)
- [Page Manipulation](https://pdfjs.express/documentation/advanced/page-manipulation)

APIs:
- [Core.Annotations.Font - toCSS(zoom)](https://pdfjs.express/api/Core.Annotations.Font.html#toCSS__anchor)
- [Core.DocumentViewer - zoomToMouse(zoom, offsetX, offsetY)](https://pdfjs.express/api/Core.DocumentViewer.html#zoomToMouse__anchor)
- [Utils - unsetCanvasMultiplier()](https://pdfjs.express/api/7.0/utils.html#unsetCanvasMultiplier__anchor)

Forums:
- [Express functionality questions](https://pdfjs.community/t/express-functionality-questions/1189/1)
- [Zoom by using mouse scroll (Not by using ctrl+scroll)](https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111/2)
- [Snap viewport to next unsigned signature](https://pdfjs.community/t/snap-viewport-to-next-unsigned-signature/1293/1)

---

<div class="post-metadata">

**Author:** ![dnavarro](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/dnavarro/32/707_2.png) [@dnavarro](https://pdfjs.community/u/dnavarro)\
**Post date:** [March 30, 2022, 6:38pm UTC](https://pdfjs.community/t/manage-zoom-in-mobile-using-pinch/1523/4 "2022-03-30T18:38:25Z")

</div>

Hi Luis,

Thanks for your question.

One idea is that you can listen for the zoom event and check if this was on a mobile device. The following is a code snippet.

```javascript
Webviewer({
...
}, document.getElementById('viewer')).then(instance => {
  const { documentViewer } = instance.Core;
  
    documentViewer.addEventListener('zoomUpdated', (e) => {
     const isMobileDevice = window.navigator.userAgent.toLowerCase().includes("mobi");
      if(isMobileDevice) {
       // is pinching in a mobile device
      }
  })

```

Let me know if this works for you.

Thank you,

Dandara
