# Manually adding StickyNotes but not displaying on pdf screen

**URL:** <https://pdfjs.community/t/manually-adding-stickynotes-but-not-displaying-on-pdf-screen/2750>\
**Category:** General Discussion\
**Created:** [July 31, 2023, 5:52am UTC](https://pdfjs.community/t/manually-adding-stickynotes-but-not-displaying-on-pdf-screen/2750 "2023-07-31T05:52:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikhilhill19](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@nikhilhill19](https://pdfjs.community/u/nikhilhill19)\
**Post date:** [July 31, 2023, 5:52am UTC](https://pdfjs.community/t/manually-adding-stickynotes-but-not-displaying-on-pdf-screen/2750/1 "2023-07-31T05:52:05Z")

</div>

Hi ,  
I am manually entering sticky note using below code by applying onClick event.  
After clicking on pdf area I am getting stickyNote value on Comment Box but not displaying on pdf screen.  
It gets displayed after I clicked the added comment in comment panel…

```javascript
const rectangleAnnot = new instanceReference.current.Core.Annotations.StickyAnnotation();
    rectangleAnnot.PageNumber = 1;
     rectangleAnnot.X = coordinate.x;
     rectangleAnnot.Y = coordinate.y;
     rectangleAnnot.Width = 200;
 rectangleAnnot.Height = 50;
     rectangleAnnot.setContents(val);

```

---

<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:** [July 31, 2023, 3:35pm UTC](https://pdfjs.community/t/manually-adding-stickynotes-but-not-displaying-on-pdf-screen/2750/2 "2023-07-31T15:35:45Z")

</div>

Hello there,

To get the annotation to appear on the viewer, you need to call the `addAnnotation` and `redrawAnnotation` APIs in our Annotation Manager class.

Please see the code snippet below:

```javascript
const { Annotations, annotationManager, documentViewer } = instance.Core;

annotationManager.addAnnotation(rectangleAnnot);
// need to draw the annotation otherwise it won't show up until the page is refreshed
annotationManager.redrawAnnotation(rectangleAnnot);

```

Here is a [link](https://pdfjs.express/api/Core.AnnotationManager.html) to our API documentation.

Hope this helps.

Best Regards,  
Darian Chen
