How to add Cloud annotation programatically?

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;

}

Hi Shahid,

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

Best Regards,
Darian

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

Thanks

1 Like