问题
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