On this page
Guides
PDF Navigation
Provide thumbnails, bookmarks, and layers to navigate PDF content.
Page Navigation
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')
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
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
})
1
2
3
4
5
2
3
4
5
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)
1
This is the parameters to apply different scroll modes.
Name | Required | Type | Description |
---|---|---|---|
mode | yes | number | Scroll Mode Parameter, Vertical: 0, Horizontal: 1 |
Thumbnails
Provide methods to render PDF pages as thumbnail images.