Manage zoom in mobile using pinch

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?

Hello, I’m Ron, an automated tech support bot :robot:

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

Guides:APIs:Forums:

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.

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