Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pinch zoom with only pdf.js #12

Open
Manmade opened this issue Apr 22, 2016 · 2 comments
Open

Use pinch zoom with only pdf.js #12

Manmade opened this issue Apr 22, 2016 · 2 comments

Comments

@Manmade
Copy link

Manmade commented Apr 22, 2016

I use pdf.js right now and I wonder if it is possible to get pinch zoom to work somehow with just pdf.js?
Thanks a lot!

@loicminghetti
Copy link
Owner

I don't think they support that in the example viewer provided, you would have to integrate it yourself.
Loic

@vyasashish
Copy link

I am using PDF.js .Now I want to do pinch zoom in PDF.js using the way you have done in TouchPDF.
I added the below code to the pdfcontainer:
$("#viewer").panzoom({
contain: 'invert'
, minScale: 1
, disablePan: true
, increment: 0.25
, maxScale: 2
, onChange: function () {
//linksDisabled = true;
console.log("inside onchange:::::::");
$("#viewer").panzoom("option", "disablePan", false);
//state = ZOOMEDIN;
}
, onEnd: function () {
setTimeout(function () {
console.log("inside onchange end:::::::");
$("#viewer").panzoom( 'zoom', {increment: .01});
//linksDisabled = false;
//if ($drag.panzoom("getMatrix")[0] == 1) zoomReset();
}, 1);
}

        });
        $("#viewer").panzoom('enable');

But still on zoom the pdf page is getting blurry.
Have I missed anything.Would be glad if you may suggest something on it.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants