# 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?

**URL:** <https://pdfjs.community/t/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/977>\
**Category:** Technical Support\
**Created:** [September 8, 2021, 6:55am UTC](https://pdfjs.community/t/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/977 "2021-09-08T06:55:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![driley](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@driley](https://pdfjs.community/u/driley)\
**Post date:** [September 8, 2021, 8:24pm UTC](https://pdfjs.community/t/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/977/3 "2021-09-08T20:24:52Z")

</div>

Hi Arman,

Please have a look at our documentation to access these properties. [PDFJS Express WebViewer Class: TextHighlightAnnotation](https://pdfjs.express/api/Core.Annotations.TextHighlightAnnotation.html)

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:

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

```

Cheers,  
Dustin

---

_[View the full topic](https://pdfjs.community/t/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/977)._
