# Programmatically highlight area on pdf using coordinates or quads

**URL:** <https://pdfjs.community/t/programmatically-highlight-area-on-pdf-using-coordinates-or-quads/847>\
**Category:** Technical Support\
**Created:** [June 24, 2021, 12:24pm UTC](https://pdfjs.community/t/programmatically-highlight-area-on-pdf-using-coordinates-or-quads/847 "2021-06-24T12:24:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chats2790](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@chats2790](https://pdfjs.community/u/chats2790)\
**Post date:** [June 24, 2021, 12:24pm UTC](https://pdfjs.community/t/programmatically-highlight-area-on-pdf-using-coordinates-or-quads/847/1 "2021-06-24T12:24:59Z")

</div>

**PDF.js Express Version**  
7.3.3

**Detailed description of issue**  
Hi team ,  
Is there a way to highlight the area on a pdf if I am getting the area coordinates from server. I could find how to highlight a searched text on your documentation but is there a way to just highlight something if I only have the coordinates not the text.

Please let me know your incites on this .

Thanks  
**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:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [June 24, 2021, 12:25pm UTC](https://pdfjs.community/t/programmatically-highlight-area-on-pdf-using-coordinates-or-quads/847/2 "2021-06-24T12:25:04Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Measure tools with PDF.js Express](https://pdfjs.express/documentation/measurement/overview)
- [Blazor PDF.js Viewer](https://pdfjs.express/documentation/blazor)
- [Angular PDF.js Viewer](https://pdfjs.express/documentation/angular)

APIs:
- [CoreControls.Math.Quad - new Quad(x1, y1, x2, y2, x3, y3, x4, y4)](https://pdfjs.express/api/CoreControls.Math.Quad.html#Quad__anchor)
- [Annotations.SelectionAlgorithm - textQuadTest(annotation, x, y)](https://pdfjs.express/api/Annotations.SelectionAlgorithm.html#textQuadTest__anchor)
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)

Forums:
- [Programmatically highlight text upon searching](https://pdfjs.community/t/programmatically-highlight-text-upon-searching/71/2)
- [Wanted to remove watermark from PDF file showing in viewer](https://pdfjs.community/t/wanted-to-remove-watermark-from-pdf-file-showing-in-viewer/150/1)
- [How to download Pdf with annotations. Not to print pdf](https://pdfjs.community/t/how-to-download-pdf-with-annotations-not-to-print-pdf/333/1)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [June 25, 2021, 3:16pm UTC](https://pdfjs.community/t/programmatically-highlight-area-on-pdf-using-coordinates-or-quads/847/3 "2021-06-25T15:16:48Z")

</div>

Hi there,

Does it have to specifically be a highlight annotation? If you just have general coordinates a better solution might be to use a rectangle annotation and just set the fill color to look like a highlighter.

Logan
