Product: PDFTron Webviewer
Product Version:8.9.0
Please give a brief summary of your issue:
annotation.getContents() is returning undefined even if there is a text in annotation.
Hello,
I am currently using 8.1.0 version of PDFTron and now upgrading it to 8.9.0 version.
I have a scenario where in 8.1.0 version I am highlighting the text in green colour when user is selecting some text, this i am doing it by using the ToolMode “AnnotationCreateTextHighlight” and adding green color. Hence when user select text it will be Highlighted in green color.
Now when user click on the annotation or text highlighted in green I have to get the text of it. In 8.1.0 version i am doing it as below using the ''annotationSelected" event listener
annotationManager.addEventListner(
“annotationSelected”,
(annotations, action) => {
this state.viewerInstance?.Core.annotationManager
.get selected annotations()
.map(annotation => {
console.log('text selected: ', annotation.getContents());
})
});
The above code was printing the text selected in 8.1.0 After upgrading it to 8.9.0 its not printing the text selected annotation.getContents() is returning undefined.
Can you please help me on this?