new AnnotationManager(documentViewer)
Parameters:
| Name | Type | Description |
|---|---|---|
documentViewer |
core.DocumentViewer | The DocumentViewer instance to which this AnnotationManager belongs. |
Methods
-
canComment()
-
Returns whether the current user can comment.
Returns:
true if the current user can comment, false otherwise.
- Type
- boolean
-
canFillForm()
-
Returns whether the current user can fill forms.
Returns:
true if the current user can fill forms, false otherwise.
- Type
- boolean
-
canModify()
-
Returns whether the current user can modify annotations.
Returns:
true if the current user can modify annotations, false otherwise.
- Type
- boolean
-
createAnnotationReply(annotation, replyAnnotation)
-
Creates a reply to the specified annotation.
Parameters:
Name Type Description annotationAnnotation The annotation to reply to.
replyAnnotationobject The reply annotation object.
Properties
Name Type Argument Description contentsnumber The contents of the reply.
authornumber <optional>
The author of the reply.
dateCreatednumber The date the reply was created.
-
deleteAnnotations(annotations)
-
Deletes the specified annotations. The annotationChanged event will be fired with a "delete" action.
Parameters:
Name Type Description annotationsThe annotations to delete.
-
demoteUserFromAdmin()
-
Demote the current user so they are no longer an admin user.
-
deselectAnnotation(annotation)
-
Deselects the specified annotation.
Parameters:
Name Type Description annotationAnnotation The annotation to deselect.
-
disableAutoSelectOnCreate()
-
Disables auto-select on create.
-
disableIndicator()
-
Disables the Form Field indicator.
-
disableReadOnlyMode()
-
Disables read-only mode, allowing annotation edits and creations.
-
drawAnnotations(options)
-
Redraws the annotations on the specified page.
Parameters:
Name Type Description optionsobject Properties
Name Type Description pageNumbernumber The page number to redraw annotations on.
-
drawAnnotationsFromList(annotationList)
-
Redraws annotations from the provided list.
Parameters:
Name Type Description annotationListArray.<Annotation> The list of annotations to redraw.
-
enableAutoSelectOnCreate()
-
Enables auto-select on create, automatically selecting newly created annotations.
-
enableIndicator()
-
Enables the Form Field indicator.
-
enableReadOnlyMode()
-
Enables read-only mode, preventing any annotation edits and creations.
-
endFormFieldFillMode()
-
Ends the Form Field Fill mode.
-
getAnnotationByName(name)
-
Returns the annotation with the specified name.
Parameters:
Name Type Description namestring The name of the annotation to get.
Returns:
The annotation with the specified name.
- Type
- Annotation
-
getAnnotationsList()
-
Returns a list of all annotations in the document.
Returns:
An array of Annotations.
- Type
- Array.<Annotation>
-
getCurrentUser()
-
Returns the current user.
Returns:
The current user.
- Type
- string
-
getRootAnnotation(annotation)
-
Returns the root annotation for the specified annotation.
Parameters:
Name Type Description annotationAnnotation The annotation to get the root for.
Returns:
The root annotation.
- Type
- Annotation
-
getSelectedAnnotation()
-
Returns the currently selected annotation.
Returns:
The currently selected annotation.
- Type
- Annotation
-
hasAnnotation(annotation)
-
Returns whether the specified annotation exists in the document.
Parameters:
Name Type Description annotationAnnotation The annotation to check.
Returns:
true if the annotation exists, false otherwise.
- Type
- boolean
-
hideAnnotations(annotations)
-
Hides all annotations in the list.
Parameters:
Name Type Description annotationsArray.<Annotation> The annotations to hide.
-
isAnnotationSelected(annotation)
-
Returns whether the specified annotation is currently selected.
Parameters:
Name Type Description annotationAnnotation The annotation to check.
Returns:
true if the annotation is selected, false otherwise.
- Type
- boolean
-
isInFormFieldFillMode()
-
Returns whether the viewer is currently in Form Field Fill mode.
Returns:
true if the viewer is in Form Field Fill mode, false otherwise.
- Type
- boolean
-
isIndicatorEnabled()
-
Returns whether the annotation indicator is enabled.
Returns:
true if the annotation indicator is enabled, false otherwise.
- Type
- boolean
-
isReadOnlyModeEnabled()
-
Returns whether read-only mode is currently enabled.
Returns:
Return whether the viewer is in readonly mode.
- Type
- boolean
-
isUserAdmin()
-
Returns whether the current user has admin privileges.
Returns:
true if the current user is an admin, false otherwise.
- Type
- boolean
-
promoteUserToAdmin()
-
Promote the current user to be an admin user. Admin users can edit any annotations.
-
selectAnnotation(annotation)
-
Selects the specified annotation.
Parameters:
Name Type Description annotationAnnotation The annotation to select.
-
setAnnotationStyles(annotation, style)
-
Sets the styles for the specified annotation.
Parameters:
Name Type Description annotationAnnotation The annotation to set the styles for.
styleobject The styles to set.
-
setCurrentUser(user)
-
Sets the current user.
Parameters:
Name Type Description userstring The user to set as the current user.
-
showAnnotations(annotations)
-
Shows all annotations in the list.
Parameters:
Name Type Description annotationsArray.<Annotation> The annotations to show.
-
startFormFieldFillMode()
-
Starts the Form Field Fill mode.