Is there a way to tell the viewer to "scrollTo" a specific page or location?

I’m reading through the documentation, but I haven’t found anything that seems like it would do this…

the use case is, we’ve searched the PDF prior to rendering it, and when we do render it… we want to start on a specific search result (i.e. the 5th occurrence of a word that shows up 20 times)…

I know the viewer support jumping to a search result… but that looks like it always starts with the first match.

Thanks!

Hello elliot,

We have:

  • documentViewer.setCurrentPage
  • documentViewer.zoomTo(zoom [, x] [, y]) which you can pass in X, Y values to zoom to (you can keep the zoom the same value)

Does this work for you?

Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

1 Like