Skip to main content
Version: Version 5 beta

Interface: PdfToolsViewerInterface

API for interacting with the PDF Viewer, exposing core functionalities for document interaction, event handling, and UI management.

Properties

addEventListener()

addEventListener: (eventName, callback) => void

Adds an event listener for a specified event.

Parameters

eventName: keyof EventMap

The name of the event to listen for.

callback: (active) => void | (color) => void | (color) => void | (opacity) => void | (thickness) => void | (shapeType) => void | () => string | (txt) => void | (annotation) => void | (annotation) => void | (annotation) => void | (pageNumber, point) => void | (pageNumber, point) => void | (cursor) => void | (pageNumber) => void | (rotation) => void | (inputDocument) => void | (componentName, payload?) => void | (fitMode) => void | (pageMode) => void | (zoom) => void | (visible?) => void | (visible?) => void | (visible?) => void | (visible?) => void | () => void | (visible?) => void | (selected, color) => void | (visible?) => void | (selected, color) => void | () => void | () => void | () => void | () => void | (active) => void | () => void | (pageNumber) => void | () => void | (options) => void | () => void | (active, options?) => void | (selected, color) => void | () => void | (options) => void | () => void | (options) => void | (active) => void | (stampType) => void | (active) => void | (color) => void | (opacity) => void | (thickness) => void | (lineEnding, direction) => void | (active) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (active, top?, left?) => void | (color) => void | (opacity) => void | (active, top?, left?) => void | (thickness) => void | (active, top?, left?, direction?) => void | (lineEnding) => void | (active) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (active) => void | (searchResult) => void | () => void | (caseSensitive) => void | (regularExpression) => void | () => void

The callback function to execute when the event is triggered.

Returns

void

void


contextualMenus

contextualMenus: ContextualMenus

Groups all the contextual menu-related API actions.


dialogs

dialogs: Dialogs

Groups all the dialog-related API actions.


document

document: Document

Groups all the document-related API actions.


documentView

documentView: DocumentView

Groups all the documentView-related API actions.


file

file: Files

Groups all the file-related API actions.


hideComponents()

hideComponents: (components) => void

Hides specified UI components in the Viewer.

Parameters

components: HideableComponentConfigName[]

List of components to hide.

Returns

void

void


lineAnnotations

lineAnnotations: LineAnnotations

Groups all the line annotations-related API actions.


overrideButtonBehavior()

overrideButtonBehavior: (buttonName, eventName, callback) => void

Overrides the behavior of a specific button.

Parameters

buttonName: string

The name of the button to override.

eventName: string

The name of the event to listen for.

callback

The callback function to execute when the event is triggered.

Returns

void

void


popovers

popovers: Popovers

Groups all the popover-related API actions.


removeEventListener()

removeEventListener: (eventName, callback) => void

Removes an event listener for a specified event.

Parameters

eventName: keyof EventMap

The name of the event to stop listening for.

callback: (active) => void | (color) => void | (color) => void | (opacity) => void | (thickness) => void | (shapeType) => void | () => string | (txt) => void | (annotation) => void | (annotation) => void | (annotation) => void | (pageNumber, point) => void | (pageNumber, point) => void | (cursor) => void | (pageNumber) => void | (rotation) => void | (inputDocument) => void | (componentName, payload?) => void | (fitMode) => void | (pageMode) => void | (zoom) => void | (visible?) => void | (visible?) => void | (visible?) => void | (visible?) => void | () => void | (visible?) => void | (selected, color) => void | (visible?) => void | (selected, color) => void | () => void | () => void | () => void | () => void | (active) => void | () => void | (pageNumber) => void | () => void | (options) => void | () => void | (active, options?) => void | (selected, color) => void | () => void | (options) => void | () => void | (options) => void | (active) => void | (stampType) => void | (active) => void | (color) => void | (opacity) => void | (thickness) => void | (lineEnding, direction) => void | (active) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (active, top?, left?) => void | (color) => void | (opacity) => void | (active, top?, left?) => void | (thickness) => void | (active, top?, left?, direction?) => void | (lineEnding) => void | (active) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (active) => void | (searchResult) => void | () => void | (caseSensitive) => void | (regularExpression) => void | () => void

The callback function to remove.

Returns

void

void


search: Search

Groups all the search-related API actions.


shapeAnnotations

shapeAnnotations: ShapeAnnotations

Groups all the shape annotations-related API actions.


showComponents()

showComponents: (components) => void

Shows specified UI components in the Viewer.

Parameters

components: HideableComponentConfigName[]

List of components to show.

Returns

void

void


stampAnnotations

stampAnnotations: StampAnnotations

Groups all the stamp annotations-related API actions.


stickyNotes

stickyNotes: StickyNotes

Groups all the sticky notes-related API actions.


toolbar

toolbar: Toolbar

Groups all the toolbar-related API actions.


topbar

topbar: Topbar

Groups all the topbar-related API actions.