Free Support Forum -

How do I know if a document has annotations using SQL?


I am wondering what the connection is between a document name (ie MyDocument.pdf) and the annotations on that document ? My use case is that I want to show a different icon for opening the annotation viewer if a document already has annotations versus a document without any annotations.


Hi John,

Thank you for the request. To get all annotations from the document you can use special method:
var svc = ObjectFactory.GetInstance();
svc.ListAnnotations("", “document name”);

Best regards.


This looks like it will work if I can get it functional. When I try this I get an error of “There is no such reviewer” stack trace:

at Groupdocs.Web.Annotation.AnnotationService.#Irdb(Int64 sessionId, Nullable`1 reviewer, AnnotationReviewerRights rights)
at Groupdocs.Web.Annotation.AnnotationService.#Irdb(String connectionId, Int64 sessionId, AnnotationReviewerRights rights)
at Groupdocs.Web.Annotation.AnnotationService.ListAnnotations(String connectionId, String fileId)
at Groupdocs.Demo.Annotation.Webforms.WebService1.checkAnnotations(String documentName) in C:\work\Groupdocs.Demo.Annotation.Webforms\Groupdocs.Demo.Annotation.Webforms\AnnotationService.asmx.cs:line 29

I have tried passing in the actual file name passed in when the document is created and the file id which is present in the file-sessions.json without escaping the \ (ie “temp\S\abcd.txt”).

Which one if either is the correct name to pass in and is the cause of this error an incorrect file name ?


Also I have noticed that the AnnotationSessions table has a column for “DocumentId”, however it looks as though this entry is null for every session. Is this supposed to be the filename of the document ? If so, how do I set it so the proper id is populated in this table ?



I’m sorry to hear that you have such issue. I was able to reproduce this error. Currently our Product team works on the next generation Annotation library which will be released very soon and the issue should be resolved in it. Since that please be patient and wait for the release, then migrate on the new version of the library.

You will be notified when the release will be available.

Sorry for the inconvenience.

Is there any update on when this new product will be released as it has been past 2 weeks now ?

Additionally, once I have the id of a specific file out of the file-sessions.json file is there a sql query I can run that will inform me if a document has any sort of annotation present ?


select count(*) from Annotations where AnnotationLayerId = ‘10010’;

or something along these lines.