Skip to main content
Version: Version 5 beta

Interface: PrintModalInterface

Interface for the print modal dialog.

Extends

  • EventHandlerInterface<"toggled" | "printStarted" | "printCompleted" | "printFailed", EventMap[PrintModalEvents]>

Properties

addEventListener()

addEventListener: (eventName, callback) => void

Adds an event listener for specified events.

Parameters

eventName: "toggled" | "printStarted" | "printCompleted" | "printFailed"

callback: (active) => void | () => void | () => void | (error) => void

Returns

void

Inherited from

EventHandlerInterface.addEventListener


cancelButton

cancelButton: PrintModalCancelButtonInterface

Groups all the API actions related to the cancel button in the print modal.


close()

close: () => void

Closes the print modal.

Returns

void

Example

viewer.dialogs.printModal.close();


emitPrintCompleted()

emitPrintCompleted: () => void

Emits a print completed event.

Returns

void


emitPrintFailed()

emitPrintFailed: (error) => void

Emits a print failed event.

Parameters

error: Error

The error that caused the print to fail.

Returns

void


emitPrintStarted()

emitPrintStarted: () => void

Emits a print started event.

Returns

void


emitToggled()

emitToggled: (active) => void

Emits a toggled event for the print modal.

Parameters

active: boolean

Indicates whether the modal is active or not.

Returns

void


getPrintOptions()

getPrintOptions: () => DocumentPrintOptions

Gets the current print options from the modal.

Returns

DocumentPrintOptions

The current print options.

Example

const options = viewer.dialogs.printModal.getPrintOptions();


isOpen()

isOpen: () => boolean

Checks if the print modal is currently open.

Returns

boolean

true if the modal is open, false otherwise.

Example

const isOpen = viewer.dialogs.printModal.isOpen();


open()

open: (options?) => void

Opens the print modal.

Parameters

options?: Partial<DocumentPrintOptions>

Optional print options to pre-populate the modal with.

Returns

void

Example

viewer.dialogs.printModal.open({ dpi: 300, pageNumbers: [1, 2, 3] });


printButton

printButton: PrintModalPrintButtonInterface

Groups all the API actions related to the print button in the print modal.


removeEventListener()

removeEventListener: (eventName, callback) => void

Removes an event listener for specified events.

Parameters

eventName: "toggled" | "printStarted" | "printCompleted" | "printFailed"

callback: (active) => void | () => void | () => void | (error) => void

Returns

void

Inherited from

EventHandlerInterface.removeEventListener


setPrintOptions()

setPrintOptions: (options) => void

Sets print options for the modal.

Parameters

options: Partial<DocumentPrintOptions>

Partial print options to update.

Returns

void

Example

viewer.dialogs.printModal.setPrintOptions({ dpi: 300 });