Skip to content
Guides

PDF Navigation

Provide thumbnails, bookmarks, and layers to navigate PDF content.

After loading a PDF document, you can programmatically interact with it, which allows you to view and transition between the pages like scrolling and jumping to specific pages.

javascript
// Previous page.
docViewer.previousPage()

// Next page.
docViewer.nextPage()

// Jump to a page.
docViewer.pageNumberChanged('3')

Scroll

To scroll to specific distances in the horizontal and vertical directions, you can use this function.

javascript
// Top and left are optional.
docViewer.scrollTo({
  top: 200,
  left: 100
})

Scroll Mode

ComPDFKit for Web has two scrolling modes: Vertical and Horizontal. You can set the corresponding mode by using the following method.

javascript
docViewer.webViewerSwitchScrollMode(mode)

This is the parameters to apply different scroll modes.

NameRequiredTypeDescription
modeyesnumberScroll Mode Parameter, Vertical: 0, Horizontal: 1

Thumbnails

Provide methods to render PDF pages as thumbnail images.