WebViewer Version: 8.9.0 (javascript)
I want to create highlight areas on a pdf from the viewer, which I managed to do by tweaking the PolygonAnnotation
.
This allows me to draw shapes on my pdf like this:
However, the area remains hoverable and when you click on it, a rectangular area is drawn around the annotation (I don’t want that):
Can you explain me how to totally remove the mouse events on the annotation (click and hover included) or how to disable this area?
My code is the following:
documentViewer.addEventListener('documentLoaded', () => {
const polygonAnnot = new Annotations.PolygonAnnotation();
polygonAnnot.addPathPoint(100, 70);
polygonAnnot.addPathPoint(300, 40);
polygonAnnot.addPathPoint(310, 70);
polygonAnnot.addPathPoint(110, 100);
polygonAnnot.PageNumber = 1;
// Styles
polygonAnnot.Color = new Annotations.Color(251, 70, 85, 1);
polygonAnnot.FillColor = new Annotations.Color(251, 70, 85, 0.4);
polygonAnnot.Locked = true;
polygonAnnot.IsHoverable = false;
polygonAnnot.LockedContents = true;
polygonAnnot.ReadOnly = true;
// Remove click and editing events
annotationManager.removeEventListener();
annotationManager.disableFreeTextEditing();
annotationManager.disableRedaction();
annotationManager.disableDraggingAcrossPages();
polygonAnnot.Author = annotationManager.getCurrentUser();
annotationManager.addAnnotation(polygonAnnot);
annotationManager.redrawAnnotation(polygonAnnot);
});
Regards