I know the coordinates and dimensions of the content I would like to highlight, but the highlight annotation only works on text. Is there a way to create an annotation that highlights a specific area of a document?
The best way to do this would be to create a yellow rectangle annotation with 50% opacity (these are the same default values used by the text highlight annotation). The code below demonstrates how to do this in the viewer:
//Create a new rectangle annotation
var rectangleMark = viewer.viewerControl.addMark(1, PCCViewer.Mark.Type.RectangleAnnotation);
//Set the coordinates and dimensions of the annotation
rectangleMark.setRectangle({x: 100, y: 100, width : 200, height: 200});
//Set fillcolor to yellow
rectangleMark.setFillColor("#FFFF00");
//Remove the border
rectangleMark.setBorderColor("transparent");
//Set opacity to 50%
rectangleMark.setOpacity(127);
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article