0

I am wondering if there is a way to know the zoom in the current document in order to navigate through documents but maintaining the zoom.

thanks,

MauroAlexandro
  • 347
  • 3
  • 6
  • 18

1 Answers1

2

You can use PSPDFKit#getZoomScale to get zoom scale for current page:

 fragment.getZoomScale(fragment.getPage());

Then, after loading new document, you can set required zoom scale with PSPDFFragment#zoomTo() like this:

 PSPDFDocument document = fragment.getDocument();
 fragment.zoomTo((int) document.getPageSize(pageToDisplay).width / 2,
                 (int) document.getPageSize(pageToDisplay).height / 2,
                 pageToDisplay, zoomScale, animationTime);   

Where animationTime can be 0 to zoom immediately without animating.

  • 3
    Also quick note: We (the PSPDFKit team) can't actively follow all StackOverflow questions. We have a great custom support team that is immensely responsive and will answer your questions at https://pspdfkit.com/support/request – tomas.surin Jan 26 '17 at 17:08
  • Thank you so much! – MauroAlexandro Jan 26 '17 at 17:50