How to get the annotation id when I highlight some text and also how to get the page no, quads and highlighted text from my annotations object?

Hi Arman,

Please have a look at our documentation to access these properties. PDFJS Express WebViewer Class: TextHighlightAnnotation

Currently it looks like you are using our obfuscated properties, there are no guarantees that these will be the same between builds.

Here are the properties you are looking for:

          console.log(highlightAnnot.Id); // ID
          console.log(highlightAnnot.Quads); // QUADS
          console.log(highlightAnnot.getContents()); // Highlighted text
          console.log(highlightAnnot.getPageNumber()); // Page Number

Cheers,
Dustin

1 Like