// For complete examples and data files, please go to https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-.NET
// Create instance of annotator.
AnnotationConfig cfg = CommonUtilities.GetConfiguration();
AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);
IDocumentDataHandler documentRepository = annotator.GetDocumentDataHandler();
if (!Directory.Exists(cfg.StoragePath))
{
Directory.CreateDirectory(cfg.StoragePath);
}
// Create document data object in storage.
var document = documentRepository.GetDocument("Document.pdf");
long documentId = document != null ? document.Id : annotator.CreateDocument("Document.pdf");
// Get annotation from storage
ListAnnotationsResult result = annotator.GetAnnotations(documentId);
return result;