GroupDocs.Annotation v21.7. and later allows you to compare annotations using the Equals method.
The following code snippet shows how to compare annotations:
// This example demonstrates how to update annotation.
// Create an instance of Annotator class
try(Annotatorannotator=newAnnotator("annotated_file.pdf")){List<AnnotationBase>annotations=annotator.get();// Create an instance of the ImageAnnotation class and add options
ImageAnnotationimageAnnotation=newImageAnnotation();imageAnnotation.setBox(newRectangle(100,100,100,100));imageAnnotation.setOpacity(0.7);imageAnnotation.setPageNumber(0);imageAnnotation.setImagePath("www.google.com.ua/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png");imageAnnotation.setAngle(100.0);for(inti=0;i<annotations.size();i++){// Compare annotations
if(imageAnnotation.equals(annotations.get(i))){// Do some stuff here...
}}}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.