PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
In WebViewer, you can click on an annotation to select it. At this point, you can use the annotationManager to get the selected annotation, as well as to programmatically select or deselect annotations. This is particularly useful when you need to get the selected annotation or when you need to select/deselect annotation programmatically. The annotationSelected and annotationDeselected events will be triggered when an annotation is selected or deselected, respectively.
You can get the selected annotations with getSelectedAnnotations of the annotationManager when the annotationSelected event is triggered or whenever needed.
const [selectedAnnotation] = annotationManager.getSelectedAnnotations()You can select an annotation with the selectAnnotation in the annotationManager.
const annotationsList = annotationManager.getAnnotationsList()
annotationManager.selectAnnotation(annotationsList[0])You can deselect an annotation with the deselectAnnotation in the annotationManager.
const [selectedAnnotation] = annotationManager.getSelectedAnnotations()
annotationManager.deselectAnnotation(selectedAnnotation)When you need to jump to a specific annotation, you can use the jumpToAnnotation API of the annotationManager to jump to that annotation.
const annotationsList = annotationManager.getAnnotationsList()
annotationManager.jumpToAnnotation(annotationsList[0])