Skip to main content
The annotation object is an instance accessible from the main MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as webViewer from the initMuPDFWebViewer() promise!

annotation

The annotation object has the following methods:

remove

Removes annotations.

Parameters

object
required
The configuration object.

Returns

Promise
required
A Promise.
Example

get

Gets annotations. Returns array of annotations.

Parameters

object
Optional configuration. If omitted, returns all annotations for all pages.

Returns

Promise<{ annotations: Annotation[] }>
required
A Promise that resolves to an object containing an Annotation[] array.
Example
The Annotation[] array contains annotation objects, also see the Working with Annotations guide.

add

Adds annotations. Returns array of added annotations.

Parameters

object
required
The configuration object.

Returns

Promise<{ annotations: Annotation[] }>
required
A Promise that resolves to an object containing an Annotation[] array.
The Annotation[] array contains annotation objects, also see the Working with Annotations guide.

set

Updates annotations.

Parameters

object
required
The configuration object.
The Annotation[] array contains annotation objects, also see the Working with Annotations guide.

undo

Undoes annotation operations and returns success status.

Returns

Promise<{ success: boolean; }>
required
A Promise that resolves to a success status.
Example

redo

Redoes undone annotation operations and returns success status.

Returns

Promise<{ success: boolean; }>
required
A Promise that resolves to a success status.
Example

Annotation Object

The Annotation object type:

Supporting Types