Skip to main content
Version: Version 5 beta

Class: PdfToolsViewer

PdfToolsViewer API This API provides methods to interact with the PDF Viewer SDK.

Extends

  • default

Implements

Constructors

new PdfToolsViewer()

new PdfToolsViewer(): PdfToolsViewer

Returns

PdfToolsViewer

Overrides

Api.constructor

Properties

contextualMenus

contextualMenus: ContextualMenusApi

Groups all the contextual menu-related API actions.

Implementation of

PdfToolsViewerInterface.contextualMenus


dialogs

dialogs: DialogsApi

Groups all the dialog-related API actions.

Implementation of

PdfToolsViewerInterface.dialogs


document

document: DocumentApi

Groups all the document-related API actions.

Implementation of

PdfToolsViewerInterface.document


documentView

documentView: DocumentViewApi

Groups all the documentView-related API actions.

Implementation of

PdfToolsViewerInterface.documentView


file

file: FilesApi

Groups all the file-related API actions.

Implementation of

PdfToolsViewerInterface.file


lineAnnotations

lineAnnotations: LineAnnotationApi

Groups all the line annotations-related API actions.

Implementation of

PdfToolsViewerInterface.lineAnnotations


popovers

popovers: PopoversApi

Groups all the popover-related API actions.

Implementation of

PdfToolsViewerInterface.popovers


search: SearchApi

Groups all the search-related API actions.

Implementation of

PdfToolsViewerInterface.search


shapeAnnotations

shapeAnnotations: ShapeAnnotationApi

Groups all the shape annotations-related API actions.

Implementation of

PdfToolsViewerInterface.shapeAnnotations


stampAnnotations

stampAnnotations: StampAnnotationsApi

Groups all the stamp annotations-related API actions.

Implementation of

PdfToolsViewerInterface.stampAnnotations


stickyNotes

stickyNotes: StickyNotesApi

Groups all the sticky notes-related API actions.

Implementation of

PdfToolsViewerInterface.stickyNotes


toolbar

toolbar: ToolbarApi

Groups all the toolbar-related API actions.

Implementation of

PdfToolsViewerInterface.toolbar


topbar

topbar: TopbarApi

Groups all the topbar-related API actions.

Implementation of

PdfToolsViewerInterface.topbar

Methods

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: () => 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 | () => void | (active) => void | () => void | (pageNumber) => void | (active) => void | () => void | () => void | () => void | () => void | (error) => void | () => void | (options) => void | () => void | (active, options?) => void | (selected, color) => void | () => void | (options) => void | () => void | (options) => void | (active) => void | (stampType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (annotation, degrees) => void | (active) => void | (color) => void | (opacity) => void | (thickness) => void | (lineEnding, direction) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (active) => void | (color) => void | (color) => void | (opacity) => void | (thickness) => void | (shapeType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (active, annotation?) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (annotation) => void | (annotation, locked) => void | (active, top?, left?) => void | (color) => void | (opacity) => void | (active, top?, left?) => void | (thickness) => void | (active, top?, left?, direction?) => void | (lineEnding) => void | (active, annotation?) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (annotation) => void | (annotation, locked) => void | (active, annotation?) => void | (annotation, locked) => void | (annotation, degree) => void | (annotation) => void | (active) => void | (searchResult) => void | () => void | (caseSensitive) => void | (regularExpression) => void | () => void

The callback function to execute when the event is triggered.

Returns

void

Implementation of

PdfToolsViewerInterface.addEventListener


dispose()

dispose(): void

Returns

void


hideComponents()

hideComponents(components): void

Hides specified UI components in the Viewer.

Parameters

components: HideableComponentConfigName[]

List of components to hide.

Returns

void

Implementation of

PdfToolsViewerInterface.hideComponents


initialize()

initialize(config, container): Promise<void>

Parameters

config: ViewerConfig

container: HTMLElement

Returns

Promise<void>


overrideButtonBehavior()

overrideButtonBehavior(buttonName, eventName, callback): void

Overrides the behavior of a specific button.

Parameters

buttonName: "pdftools-icon-button-save"

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

Implementation of

PdfToolsViewerInterface.overrideButtonBehavior


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: () => 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 | () => void | (active) => void | () => void | (pageNumber) => void | (active) => void | () => void | () => void | () => void | () => void | (error) => void | () => void | (options) => void | () => void | (active, options?) => void | (selected, color) => void | () => void | (options) => void | () => void | (options) => void | (active) => void | (stampType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (annotation, degrees) => void | (active) => void | (color) => void | (opacity) => void | (thickness) => void | (lineEnding, direction) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (active) => void | (color) => void | (color) => void | (opacity) => void | (thickness) => void | (shapeType) => void | (annotation) => void | (annotation, error) => void | (annotation, locked) => void | (active, annotation?) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (annotation) => void | (annotation, locked) => void | (active, top?, left?) => void | (color) => void | (opacity) => void | (active, top?, left?) => void | (thickness) => void | (active, top?, left?, direction?) => void | (lineEnding) => void | (active, annotation?) => void | (triggerEl) => void | (triggerEl) => void | (triggerEl) => void | () => void | (annotation) => void | (annotation, locked) => void | (active, annotation?) => void | (annotation, locked) => void | (annotation, degree) => void | (annotation) => void | (active) => void | (searchResult) => void | () => void | (caseSensitive) => void | (regularExpression) => void | () => void

The callback function to remove.

Returns

void

Implementation of

PdfToolsViewerInterface.removeEventListener


showComponents()

showComponents(components): void

Shows specified UI components in the Viewer.

Parameters

components: HideableComponentConfigName[]

List of components to show.

Returns

void

Implementation of

PdfToolsViewerInterface.showComponents