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,
您可以使用PSPDFKit#getZoomScale
获取当前页面的缩放比例:
fragment.getZoomScale(fragment.getPage());
然后,在加载新文档后,您可以像这样设置所需的缩放比例PSPDFFragment#zoomTo()
:
PSPDFDocument document = fragment.getDocument();
fragment.zoomTo((int) document.getPageSize(pageToDisplay).width / 2,
(int) document.getPageSize(pageToDisplay).height / 2,
pageToDisplay, zoomScale, animationTime);
哪里animationTime
可以为 0 立即缩放而不进行动画处理。