Gets the current state of the annotations loaded in the viewer. Intended to give you a way to export annotations from one viewer so that you can reload them later in a different viewer via loadAnnotations.
Note that the array of objects returned by getAnnotations
are merely a copy of the annotations in the viewer. Any changes you make to these objects WILL NOT affect the actual annotations in the viewer, and any changes made by the user to the annotations in the viewer WILL NOT affect the state of the objects returned from this method. Use getAnnotations
to simply get a copy of the current state of the annotations in the viewer.
Loads annotations into the viewer. Intended for reloading annotations previously exported by a call to getAnnotations.
Will not remove any annotations which already exist in the viewer. Can be called repeatedly to load more annotations.
Every item in this array must include a unique id
(which is not already in use by an annotation already loaded in the viewer) and be one of:
TextHighlight
annotation must include a renderingMetadata
array formerly exported from PdfViewerControl.getAnnotationsPromise which resolves to an empty Object
Removes an event handler for the event named eventName
.
Name of the event. EventName
Event handler function to be removed.
Control instance PdfViewerControl
Attaches an event handler for the event named eventName
.
Name of the event. EventName
Function to be executed when the event is emitted.
Control instance PdfViewerControl
Attaches an event handler for the event named eventName
. The event handler is removed after the first event is emitted.
Name of the event. EventName
Function to be executed when the event is emitted.
Control instance PdfViewerControl
Attaches an event handler for the event named eventName
to the head of the list of handlers.
Name of the event. EventName
Function to be executed when the event is emitted.
Control instance PdfViewerControl
Attaches an event handler for the event named eventName
to the head of the list of handlers. The event handler is removed after the first event is emitted.
Name of the event. EventName
Function to be executed when the event is emitted.
Control instance PdfViewerControl
Removes all event handlers for the event named eventName
. If no eventName
is provided, all event handlers are removed.
Control instance PdfViewerControl
Creates a new PDF viewer within a page.
Configuration for display of tools and controls in the user interface. Some controls may be hidden/shown/moved due to space or touch gesture considerations depending on the device and viewport. If undefined, uses default interface controls defined below.
Whether controls to view and navigate by annotations are available to the user.
Whether the ellipse tool is available to the user in the toolbar, allowing them to create new ellipse annotations.
Whether the freehand drawing tool is available to the user in the toolbar, allowing them to create freehand drawing annotations.
Whether the freehand signature tool is available to the user in the toolbar, allowing them to draw their signature and place it as an annotation on the document.
Whether the full screen toggle button is available to the user.
Note that, even when true
, the full screen toggle may still be hidden if the viewer
is too small.
Whether the line tool is available to the user in the toolbar, allowing them to create new line annotations.
Whether next and previous page navigation buttons are available to the user.
Whether controls to view and navigate by document outline are available to the user.
Whether the current page number and total page count are displayed to the user. When displayed, the user can also tap/click on the displayed current page number to input a specific page number to change to.
Whether printing controls are available to the user.
Note that, even when true
, printing controls are hidden when a mobile-friendly
interface is shown since mobile printing is not currently supported.
Whether the rectangle tool is available to the user in the toolbar, allowing them to create new rectangle annotations.
Whether search controls are available to the user.
Whether the text highlight tool is available to the user in the toolbar, allowing them to create text highlight annotations.
Whether controls to view and navigate by page thumbnails are available to the user.
Whether zoom in and zoom out buttons are available to the user.
Note that, even when true
, these buttons may still be hidden if the viewer is too small.
Zooming is always possible via touchscreen gestures and via keyboard and mousewheel actions.
DOM element where the viewer should be created.
Optional. PDF Viewer license key.
When not provided, the viewer will be limited to free features and will include "Powered by Accusoft" branding.
When the value "eval"
is provided, the viewer will be created in Evaluation Mode, which will allow paid features to be evaluated,
and will apply additional branding, such as a full page watermark.
PDF document to open.
Must be one of the following types:
string
URL to a PDF. Both standard and data URLs are supported.Uint8Array
A byte array of the contents of the PDF document.ViewingSession
A Prizmdoc ViewingSession object.
Instance of the PDF Viewer