I'm using PDF.js for rendering my documents on a web app I'm working on.
However I need to enable pinch to zoom on mobile devices for this and it doesn't look like the library itself allows native zooming.
Is there a library that I could use to the code to simulate (at the very least) pinch and zoom on the same scale as the viewers dropdown zoom selection?
I had found an answer to this solution. I ended up using hammer.js for the pdf.js
http://hammerjs.github.io/
edit
var mc = new Hammer.Manager(myElement, myOptions);
mc.add( new Hammer.Pan({ direction: Hammer.DIRECTION_ALL, threshold: 0 }) );
mc.add( new Hammer.Tap({ event: 'quadrupletap', taps: 4 }) );
mc.on("pan", handlePan);
mc.on("quadrupletap", handleTaps);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With