Enabling pinch to zoom

Which product are you using?
PDF.js Express Viewer on an Angular web app

PDF.js Express Version
8.1.0

Detailed description of issue
I cannot get pinch to zoom working at all. If I double tap on a pdf it zooms in/out and even panning is acting weird. I need to brush my finger across the screen. Tapping and dragging does nothing. I am using a react native webview component on ios and I can confirm pinch to zoom & panning works when viewing other websites including your viewer demo on your website. I feel like Im missing something obvious here but just cant figure it out.

Expected behaviour
Pinch to zoom functionality just like in the viewer demo on your website.

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

One more note. I accessed my express js viewer build through my browser on the same device and pinch to zoom still did not work, so that rules out the react native web-viewer as the culprit.

Hi @adam.beer

I would recommend to update to the latest version of Express (8.7) and see if this is still an issue.

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.

8.7 still has this issue.

@zserviss Im using the Angular app sample. This is reproducible by just using:

I also manually changed to version 8.7 before running npm install so I verified that this is still an issue on the latest version.

If you run the Angular app and access it through a mobile device, panning and pinch to zoom are both issues.

@zserviss Any insight as to what could be going on? Id like to avoid having to rewrite my app outside Angular

Hello adam.beer,

Can you try with this build here? Sign in to your account

Best regards,
TylerGordon

@tgordon I had to add a license key to the viewer sample to get it to work but yes that build worked as expected. This example doesnt seem to be using Angular though and Id really like to keep using Angular so I dont need to re-write my entire web app.

@tgordon Sorry I should have been more specific in my last post. How can I get this working in Angular?

Hi there,

I am not too familiar with Angular but could you use a public library like this one:

We also have a isPinching method available in our PanTool for troubleshooting:
https://pdfjs.express/api/Core.Tools.PanTool.html#isPinching__anchor

Best regards,
Kevin Kim