Free Support Forum -

How do I get a list of annotations for a document?


I need to get the number of annotations for a document. It looks like I could possibly get it from IAnnotationService.ListAnnotations() but this method requires the connectionId which I don’t know how to get.

I’m using the Groupdocs for .NET v1.4.



Hello Jason,

Here is a source code which performs what you have required.

var sessionId = Groupdocs.Web.Annotation.FileSessionMapper.Instance[“folder/file.ext”];
var annotationSvc = StructureMap.ObjectFactory.GetInstance<Groupdocs.Core.IAnnotationService>();
var annotations = annotationSvc.GetSessionAnnotations(sessionId);

Where “folder/file.ext” is a target document in the root storage where annotations are present.

If you will have more questions please feel free to contact us.