Instance API
Annotations and Selection
Create, update, delete, and select annotations with ViewerInstance APIs.
Annotation CRUD
create(annotation | annotation[])update(annotation | annotation[])delete(id | ids | annotations)getAnnotations(pageIndex?)
Selection helpers
getSelection()getTextSelection()setSelectedAnnotations(...)getSelectedAnnotations()
Deletion patterns
- API (compat):
delete(id | ids | annotations) - API (core):
deleteAnnotation(id)anddeleteAnnotations(ids) - Chrome UI:
- Press
DeleteorBackspacewhen annotations are selected. - Use the delete button in the annotations sidebar row.
- Press
Fast creation from text selection
createNoteFromSelection(contents?)createLinkFromSelection(url)createHighlightFromSelection()createUnderlineFromSelection()
Mode and author
setAnnotationMode(mode)getAnnotationMode()setAnnotationCreatorName(name)getAnnotationCreatorName()