Product: WebViewer
Please describe your issue and provide steps to reproduce it:
I’m adding an import button for the WebViewer which is supposed to extract the text of all highlights. But it seems that the text is not a part of the annotation. The code below makes a button and on click it goes through all annotations and if an annotation was done outside of the WebViewer it is going to delete and redraw it. I want to extract the text of those annotations.
instance.UI.setHeaderItems(header => {
header.push({
type: 'actionButton',
img: 'https://img.icons8.com/material/24/000000/download--v1.png',
onClick: () => {
const annots = annotManager.getAnnotationsList();
//List of all external (previously existing; to import) annotations
let externalAnnot = [];
annots.forEach((annot) => {
if (!annot.getCustomData('internal') && annot.Subject != null) {
annot.setCustomData('internal', true)
externalAnnot.push(annot)
}
});
externalAnnot.forEach((annot) => {
annotManager.deleteAnnotation(annot);
annotManager.addAnnotation(annot);
annotManager.drawAnnotationsFromList(annot);
}
How can I get the text of externalAnnot?
When highlighting on the WebViewer itself, it automatically extracts the text of the highlight and sets it as the Content of the annotation. But here, drawing/redrawing the highlight will not do that.