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 annotation with the annotationManager when the annotationSelected event is triggered or whenever needed.
const annotationManager = docViewer.getAnnotationManager()
const selectedAnnotation = annotationManager.getSelectedAnnotation()You can select an annotation with the selectAnnotation in the annotationManager.
const annotationManager = docViewer.getAnnotationManager()
const annotationsList = annotationManager.getAnnotationsList()
annotationManager.selectAnnotation(annotationsList[0])You can deselect an annotation with the deselectAnnotation in the annotationManager.
const annotationManager = docViewer.getAnnotationManager()
const selectedAnnotation = annotationManager.getSelectedAnnotation()
annotationManager.deSelectAnnotation(selectedAnnotation)When you need to jump to a specific annotation, you can use the jumpToAnnotation API to jump to that annotation.
const annotationManager = docViewer.getAnnotationManager()
const annotationsList = annotationManager.getAnnotationsList()
docViewer.jumpToAnnotation(annotationsList[0])