How to add an icon to a text field?

WebViewer Version: 8.0.1

Please give a brief summary of your issue:
I would like to add an icon to certain text annotations, it should be a sibling element to the actual tag inside the text annotation

I’m interested to know: What’s the best approach for doing this?

My current approach is to get a list of the annotations after they have been loaded, and append the icon html into the element attribute of the annotation.

This works, but only for the pages that have been rendered, for the pages that have not been rendered, the element attribute is null

Is there a way to access or modify this outer display element?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hi @jTi,

Thanks for reaching out to us!

I recommend taking a look at the AnnotationManager annotationsDrawn event. Instead of trying to update all annotations at once, you can listen for draw events fired when a page’s annotations are drawn to the canvas. The event gives you the page number so you’d have to filter annotations by page number and update accordingly.

Let me know how this works!

Best Regards,
Adam Sinclair
Software Developer
PDFTron Systems, Inc.