Skip to main content
Version: Version 5 beta

Interface: Dialogs

Groups all the API actions related to dialogs in the Viewer.

Properties

thumbnailsSidebar

thumbnailsSidebar: object

Groups all the API actions related to the thumbnails sidebar dialog.

addEventListener()

addEventListener: (eventName, fn) => void

Adds an event listener to the thumbnail click event.

Parameters

eventName: "thumbnailClicked"

The event name to listen for (e.g., 'thumbnailClicked').

fn

The callback function to execute when the event is triggered.

Returns

void

Example

PdfToolsViewerApi.dialogs.thumbnailsSidebar.addEventListener('thumbnailClicked', () => { console.log('callback') });

thumbnailClicked()

thumbnailClicked: (pageNumber) => void

Triggered when a thumbnail in the sidebar is clicked.

Parameters

pageNumber: number

The page number of the clicked thumbnail.

Returns

void

Example

PdfToolsViewerApi.dialogs.thumbnailsSidebar.thumbnailClicked(4);