annotation
object is an instance accessible from the main MuPDFWebViewer instance as follows:
mupdf
from the initMuPDFWebViewer() promise!annotation
object has the following methods:
get(config?: { pageIndex: number })
Gets annotations. Returns array of annotations.
Promise<Annotation[]>
.Annotation[]
array object is an array of JSON objects representing each annotation - see the Working with Annotations guide.set(config: { annotations: Annotation[], emitEvent?: boolean })
Updates annotations.
oid
or name
and pageIndex
as the unique key for the each required annotation.The Annotation[]
array object is an array of JSON objects representing each annotation - see the Working with Annotations guide.add(config: { annotations: Annotation[]; emitEvent?: boolean })
Adds annotations. Returns array of added annotations.
Promise<Annotation[]>
.Annotation[]
array object is an array of JSON objects representing each annotation - see the Working with Annotations guide.remove(config: { annotations: Array<{ name: string, pageIndex: number } | { oid: number, pageIndex: number }>, emitEvent?: boolean })
Removes annotations.
Promise
.undo()
Undoes annotation operations and returns success status.
Promise<{ success: boolean; }>
.redo()
Redoes undone annotation operations and returns success status.
Promise<{ success: boolean; }>
.