# Do we have the capability for programmatically highlighting?

**URL:** <https://pdfjs.community/t/do-we-have-the-capability-for-programmatically-highlighting/2987>\
**Category:** Technical Support\
**Created:** [December 6, 2023, 12:47am UTC](https://pdfjs.community/t/do-we-have-the-capability-for-programmatically-highlighting/2987 "2023-12-06T00:47:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raygan.lasic](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@raygan.lasic](https://pdfjs.community/u/raygan.lasic)\
**Post date:** [December 6, 2023, 12:47am UTC](https://pdfjs.community/t/do-we-have-the-capability-for-programmatically-highlighting/2987/1 "2023-12-06T00:47:33Z")

</div>

**Which product are you using?**

**PDF.js Express Version**

**Detailed description of issue**  
We are trying to evaluate the plus version and would like to incorporate to our system. Couple of questions if this is supported on the plus / custom version

1. Do we have the functionality to programmatically retrieve highlighted text? The concept involves enabling users to highlight specific sentences or words, with the ability for us to capture the text and save it in our system.

2. Can we programmatically highlight text and sentences? We aim to dynamically highlight or color text or sentences in the PDF, with the content originating from our system. Can we highlight this based on some vector instead of text?

**Expected behaviour**  
{Provide a screenshot or description of the expected behaviour}

**Does your issue happen with every document, or just one?**  
{Answer here}

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
{Provide a relevant code snippet}

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [December 6, 2023, 11:13pm UTC](https://pdfjs.community/t/do-we-have-the-capability-for-programmatically-highlighting/2987/2 "2023-12-06T23:13:02Z")

</div>

Hello raygan.lasic,

1. Get highlighted text from a highlight annotation:

```javascript
<instance of a highlight annotation>.getCustomData('trn-annot-preview');

```

1. Creating highlights programatically with coordinates: [PDF.js Express Highlight Annotation | Documentation](https://pdfjs.express/documentation/annotation/create-annotation-highlight)

Let me know if you have any additional questions

Best regards,  
Tyler
