Skip to main content
Version: Version 5 beta

Interface: Dialogs

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

Properties

passwordModal

passwordModal: object

Groups all the API actions related to the password modal dialog.

addEventListener()

addEventListener: (eventName, callback) => void

Parameters

eventName: "toggled"

callback

Returns

void

emitToggled()

emitToggled: (active) => void

Parameters

active: boolean

Returns

void

unlockButton

unlockButton: object

unlockButton.addEventListener()

addEventListener: (eventName, callback) => void

Parameters

eventName: "clicked"

callback

Returns

void

unlockButton.emitClicked()

emitClicked: () => void

Returns

void


thumbnailsSidebar

thumbnailsSidebar: object

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

addEventListener()

addEventListener: (eventName, callback) => void

Adds an event listener to the thumbnail click event.

Parameters

eventName: "thumbnailClicked"

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

callback

The callback function to execute when the event is triggered.

Returns

void

Example

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

emitThumbnailClicked()

emitThumbnailClicked: (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.emitThumbnailClicked(4);