usmanazizgroupdocs
3/15/2016 - 3:14 PM

CreateDocument.cs

// 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("sample.pdf");
long documentId = document != null ? document.Id : annotator.CreateDocument("sample.pdf");

Console.WriteLine("Document ID : " + documentId);