pdf.js:如何使用pdf.js获取当前的PDF页码?

3
我希望在用户点击某个按钮时,从pdf.js中获取当前页面号。我没有像using iframe">此链接那样在iframe中打开pdf文件。我直接从GitHub Project">GitHub项目中使用pdf.js。我的问题是如何获取当前页码。

pdf.js


尝试使用这个 http://stackoverflow.com/a/35887722 - Marcus Li
1个回答

7

PDFViewerApplication.pdfViewer.currentPageNumber是一个获取器和设置器。示例:

// Go to page 5
PDFViewerApplication.pdfViewer.currentPageNumber = 5;

// Move two pages forward
PDFViewerApplication.pdfViewer.currentPageNumber += 2;

在我的情况下,我使用的是PDFJS.pdfViewer.currentPageNumber。但它是未定义的。 - Vishnu
1
PDFJS.pdfViewer._currentPageNumber 对我有用。虽然有点晚,但是需要的人可以找到它有用。 - Gigarthan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接