# How to set value of "trn-custom-data" for creating highlight annotations?

**URL:** <https://pdfjs.community/t/how-to-set-value-of-trn-custom-data-for-creating-highlight-annotations/1695>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [May 20, 2022, 8:13am UTC](https://pdfjs.community/t/how-to-set-value-of-trn-custom-data-for-creating-highlight-annotations/1695 "2022-05-20T08:13:51Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![arman](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@arman](https://pdfjs.community/u/arman)\
**Post date:** [May 23, 2022, 6:08am UTC](https://pdfjs.community/t/how-to-set-value-of-trn-custom-data-for-creating-highlight-annotations/1695/5 "2022-05-23T06:08:50Z")

</div>

When I create TextHiglightAnnotation by programmatically then it make difference from the default pdfjs highlight tool.

Here is my code.

```javascript
const highlight = new Annotations.TextHighlightAnnotation();
        highlight.Author = annot.Author;
        highlight.Hidden = false;
        highlight.Quads = annot.Quads;
        highlight.StrokeColor = new Annotations.Color(255, 176, 176, 1);
        highlight.PageNumber = annot.getPageNumber();
        highlight.Locked = false;
        highlight.setCustomData("trn-custom-data", "Test Data");
        highlight.Subject = 'Highlight';
        annotManager.addAnnotation(highlight, true);
        annotManager.drawAnnotations(1);

```

Output:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/aedfe5eb76855fad5c53c6ac073d46c3588da355.png)

---

_[View the full topic](https://pdfjs.community/t/how-to-set-value-of-trn-custom-data-for-creating-highlight-annotations/1695)._
