# How can I get the selected text of a current selected highlight annotation

**URL:** <https://pdfjs.community/t/how-can-i-get-the-selected-text-of-a-current-selected-highlight-annotation/2777>\
**Category:** Technical Support\
**Created:** [August 10, 2023, 1:45pm UTC](https://pdfjs.community/t/how-can-i-get-the-selected-text-of-a-current-selected-highlight-annotation/2777 "2023-08-10T13:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beatriz.patriota](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@beatriz.patriota](https://pdfjs.community/u/beatriz.patriota)\
**Post date:** [August 10, 2023, 1:45pm UTC](https://pdfjs.community/t/how-can-i-get-the-selected-text-of-a-current-selected-highlight-annotation/2777/1 "2023-08-10T13:45:32Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

---

<div class="post-metadata">

**Author:** ![darian.chen](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@darian.chen](https://pdfjs.community/u/darian.chen)\
**Post date:** [August 10, 2023, 11:28pm UTC](https://pdfjs.community/t/how-can-i-get-the-selected-text-of-a-current-selected-highlight-annotation/2777/3 "2023-08-10T23:28:15Z")

</div>

Hello Beatriz,

To get the selected text, you can use the **textSelected** API.

**API** : [PDFJS Express WebViewer Class: DocumentViewer](https://pdfjs.express/api/Core.DocumentViewer.html#event:textSelected)

Best Regards,  
Darian Chen
