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,

4

1 回答 1

2

您可以使用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 立即缩放而不进行动画处理。

于 2017-01-26T14:52:05.083 回答