Issue with Setting Highlight Color

WebViewer Version: 11.2.0

Please give a brief summary of your issue:
Was previously using this code snippet to update the color of the highlights made with the text popup highlight button on version 10.12. Once updating to version 11.2.0 it stopped working, I’ve looked in the documentation to try to resolve this issue, but the examples I tried did not resolve my issue.

documentViewer.getTool('AnnotationCreateTextHighlight').setStyles(() => ({
   StrokeColor: new Annotations.Color(255, 255, 0),
}));
1 Like

Hello Aaron,

Thank you for contacting WebViewer Forums.

I would recommend reviewing the setStyles change under the v11 migration guide here: Migrating to V11 of WebViewer | Apryse documentation

SetStyles no longer accepts a function so to change the color of the highlight annotation in v11, please see the following code as an example:

documentViewer.getTool('AnnotationCreateTextHighlight').setStyles({
   StrokeColor: new Annotations.Color(0, 255, 0),
});

Regards,
Luke

1 Like