pdf.js: Changing current page number programmatically

徘徊边缘 提交于 2019-12-21 21:19:41

问题


With pdf.js is there a way to programmatically change the current page of a PDF being viewed? For example, a call to change the current page to page 5.

(I know that I can initially set the page by specifying the page number in the URL, but I want to change it programmatically after it has been opened.)


回答1:


PDFViewerApplication.pdfViewer.currentPageNumber is a getter and setter. Examples:

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

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


来源:https://stackoverflow.com/questions/31615248/pdf-js-changing-current-page-number-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!