# How to add Cloud annotation programatically?

**URL:** <https://pdfjs.community/t/how-to-add-cloud-annotation-programatically/3061>\
**Category:** Technical Support\
**Created:** [January 9, 2024, 10:54am UTC](https://pdfjs.community/t/how-to-add-cloud-annotation-programatically/3061 "2024-01-09T10:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahid.shaikh](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@shahid.shaikh](https://pdfjs.community/u/shahid.shaikh)\
**Post date:** [January 9, 2024, 10:54am UTC](https://pdfjs.community/t/how-to-add-cloud-annotation-programatically/3061/1 "2024-01-09T10:54:40Z")

</div>

Please fill out the following template as best you can. .  
 →   
**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.7.4

**Detailed description of issue**  
How can I add the cloud annotations programmatically ?

**Code snippet**

I am adding simple polygon tool like below how to add cloud annotations ?

```
const createPolygonAnnotations = (annotationData: any, doc: any, Annotations: any, annotationsManger: any) => {
        const polygonAnnotation = new Annotations.PolygonAnnotation();
        polygonAnnotation.PageNumber = Number(annotationData.page);
        const vertices = convertToCoordinateObjects(annotationData.coordinates)
        polygonAnnotation.ga = vertices
        polygonAnnotation.CustomData = {
   
          addedType: 'programmatically',
        };

return polygonAnnotation;

```

}

---

<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:** [January 9, 2024, 4:49pm UTC](https://pdfjs.community/t/how-to-add-cloud-annotation-programatically/3061/2 "2024-01-09T16:49:09Z")

</div>

Hi Shahid,

To clarify, are you referring to this tool in the shapes ribbon group?

 ![Screenshot 2024-01-09 at 11.47.15 AM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/b/b4f552c0af65f07672c049423baed2e78282b23c.png)

Best Regards,  
Darian

---

<div class="post-metadata">

**Author:** ![shahid.shaikh](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@shahid.shaikh](https://pdfjs.community/u/shahid.shaikh)\
**Post date:** [January 10, 2024, 5:43am UTC](https://pdfjs.community/t/how-to-add-cloud-annotation-programatically/3061/3 "2024-01-10T05:43:43Z")

</div>

Now it working I just need to se the border style using the setBorderStyle(‘cloudy’)

Thanks
