How to do two annotation Groupby programatically?

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.7.4

Detailed description of issue
I am adding two annotations RectangleAnnotation and FreeTextAnnotation annotation programmatically using the same coordinates I want to do groupby that both annotation programmatically how can i do it ? Please share reference or code to do it .

image
I am showing annotation like above snapshot want to do group by programmatically ?

Thank you for posting your question to our forum. We will provide you with an update as soon as possible.

Hello Shahid,

After creating the two annotations you can use the groupAnnotations API to group them.
https://pdfjs.express/api/Core.AnnotationManager.html#groupAnnotations__anchor


    annotationManager.addAnnotation(rectangleAnnot);
    annotationManager.addAnnotation(freeTextAnnot);
    annotationManager.drawAnnotationsFromList([rectangleAnnot, freeTextAnnot]);

    // Group the annotations together
    annotationManager.groupAnnotations(rectangleAnnot, [freeTextAnnot]);

Best Regards,
Darian