# Change style for sticky annotation

**URL:** <https://pdfjs.community/t/change-style-for-sticky-annotation/912>\
**Category:** Technical Support\
**Created:** [July 29, 2021, 7:02pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912 "2021-07-29T19:02:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlaw](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rlaw](https://pdfjs.community/u/rlaw)\
**Post date:** [July 29, 2021, 7:02pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/1 "2021-07-29T19:02:54Z")

</div>

**PDF.js Express Version**

**Detailed description of issue**  
Hello, I’m looking to change the color of the sticky annotation entirely. I am using the `setCustomDrawHandler` to change the `fillStyle` but that is changing the color of the entire annotation. I’m looking to change the border as well as the inside of the icon to different colors. See attached screenshot. Note: I have the numbering system complete, I am just asking about the styles. Appreciate the help!

**Expected behaviour**  
 ![Screen Shot 2021-07-29 at 11.59.55 AM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/b0f4aed6df4066c90e8feca826871ba05d630dc2.png)

**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:** [July 29, 2021, 7:02pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/2 "2021-07-29T19:02:58Z")

</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:
- [Create custom annotation styles](https://pdfjs.express/documentation/annotation/customizing-default-annotation-styles)
- [Annotations tools](https://pdfjs.express/documentation/annotation/annotations-and-tools)
- [Add signature fields to PDFs - createSignHereElement](https://pdfjs.express/documentation/signature/signature-field#createsignhereelement)

APIs:
- [Annotations.StickyAnnotation - setPageNumber(value)](https://pdfjs.express/api/Annotations.StickyAnnotation.html#setPageNumber__anchor)
- [Annotations.TextSquigglyAnnotation - adjustRect()](https://pdfjs.express/api/Annotations.TextSquigglyAnnotation.html#adjustRect__anchor)
- [Tools.TextUnderlineCreateTool - setStyles(newStyles)](https://pdfjs.express/api/Tools.TextUnderlineCreateTool.html#setStyles__anchor)

Forums:
- [To replace Count tool icon by custom icon [Pdfjs-express 7.0]](https://pdfjs.community/t/to-replace-count-tool-icon-by-custom-icon-pdfjs-express-7-0/174/2)
- [How to add scale and color to the converted annotation](https://pdfjs.community/t/how-to-add-scale-and-color-to-the-converted-annotation/305/2)
- [Rotate StampAnnotation](https://pdfjs.community/t/rotate-stampannotation/180/2)

---

<div class="post-metadata">

**Author:** ![rlaw](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rlaw](https://pdfjs.community/u/rlaw)\
**Post date:** [July 29, 2021, 8:58pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/3 "2021-07-29T20:58:30Z")

</div>

This is the best I could do at the moment.

![Screen Shot 2021-07-29 at 1.58.06 PM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/486238b19318cbfe86feb405b6a0acf0b081d0c4.png)

---

<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:** [July 30, 2021, 4:52pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/4 "2021-07-30T16:52:48Z")

</div>

Hey!

Looking in to this now, the best I can do so far is what you have done as well lol. These `nozoom` annotations are a bit tricky when it comes to customizing.

Will get back to you once I find a solution.

Thanks!  
Logan

---

<div class="post-metadata">

**Author:** ![rlaw](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rlaw](https://pdfjs.community/u/rlaw)\
**Post date:** [July 30, 2021, 4:55pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/5 "2021-07-30T16:55:36Z")

</div>

Okay sounds good Logan. Appreciate the help!

---

<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:** [July 30, 2021, 5:11pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/6 "2021-07-30T17:11:42Z")

</div>

Hey there,

Looked into the source code a bit and unfortunately this is not possible at the moment. We have a function that draws that comment bubble on the canvas and it has the stroke color hard coded to black, and unfortunately that function cannot be overridden/replaced due to our obfuscation techniques.

Our UI does not have the option to set the stroke color of these icons either (for the same reason).

For now you will have to make due with just setting `StrokeColor` to something that looks good with your number icon.

Edit: I was just informed that the PDF Specification does not let you set a border color, which is why we implemented it this way

Sorry about that.

Thanks,  
Logan

---

<div class="post-metadata">

**Author:** ![rlaw](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rlaw](https://pdfjs.community/u/rlaw)\
**Post date:** [August 2, 2021, 6:43pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/7 "2021-08-02T18:43:16Z")

</div>

No worries Logan. Thanks for the insight.

---

<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:** [August 4, 2021, 3:40pm UTC](https://pdfjs.community/t/change-style-for-sticky-annotation/912/8 "2021-08-04T15:40:50Z")

</div>


