GroupDocs is proud to announce public release of Next Generation GroupDocs.Annotation Cloud 17.12. It is based on GroupDocs.Annotation for .NET, so providing same proven predictable results for annotation functionality in Cloud. The GroupDocs.Annotation Cloud is a RESTful API that manipulates the annotations in all common business file formats. It allows the developers to manage interactive and explanatory annotations to specific words, phrases and regions of the documents content in any cross platform application. It supports all major Text and Figure annotations and top of the all, it provides these annotation features without having to install any third party software. Please check release notes for complete list of features of first version of GroupDocs.Annotation Cloud. The following sections describe some details regarding these features.

Import Annotations

While manipulating annotations, importing the annotations from documents is basic requirement of an application. You can easily import annotation using following REST API, it lists annotation as AnnotationInfo Object. Please see the following URI, REST command(Curl) and .NET SDK example for the purpose. URI

https://api.groupdocs.cloud/v1/annotation/{filename}/annotations

Rest example(cURL)

curl -v "https://api.groupdocs.cloud/v1/annotation/Annotated.pdf/annotations" \
-X GET \
-H "Content-Type: application/json" \
-H "authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” 

.NET SDK example

//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
var configuration = new Configuration
{
    AppSid = Sid,
    AppKey = Key
};

var apiInstance = new AnnotationApi(configuration);

try
{
    var request = new GetImportRequest()
    {
        Name = "Annotated.pdf",
        Folder = null,
        Password = null
    };

    // Import annotations from document
    var response = apiInstance.GetImport(request);
    foreach (var entry in response)
        Debug.Print("Box :" + entry.Box);
}
catch (Exception e)
{
    Debug.Print("Exception when getting Annotation Information: " + e.Message);
} 

Export Annotation

The GroupDocs.Annotation Cloud REST API to add figure and text annotation in the supported document. You can use following API to add(export) annotation to the document. It expects AnnotationInfo Object in the request body. Please see the following URI, JSON Request data, REST command(Curl) and .NET SDK example for the purpose. URI

https://api.groupdocs.cloud/v1/Annotation/{filename}/html/pdf

Request Data

[{"creatorName":"Anonym A.","box":{ "x":173.0, "y":154.89, "width":142.5, "height":9.0 },"pageNumber":0,"annotationPosition":{ "x":173.0, "y":154.88999938964844 },"svgPath":"[{'x':173.2986,'y':687.5769},'x':315.7985,'y':687.5769},{'x':173.2986,'y':678.5769},{'x':315.7985,'y':678.5769}]","type":0,"replies":[{ "userName":"Admin", "message":"reply text", "repliedOn":"2017-03-16T18:19:14" },{ "userName":"Commentator", "message":"reply2 text", "repliedOn":"2017-03-16T18:19:14" }]}] 

Rest example(cURL)

curl -v "https://api.groupdocs.cloud/v1/annotation/Annotated.pdf/annotations" \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[{"creatorName":"Anonym A.","box":{ "x":173.0, "y":154.89, "width":142.5, "height":9.0 },"pageNumber":0,"annotationPosition":{ "x":173.0, "y":154.88999938964844 },"svgPath":"[{'x':173.2986,'y':687.5769},'x':315.7985,'y':687.5769},{'x':173.2986,'y':678.5769},{'x':315.7985,'y':678.5769}]","type":0,"replies":[{ "userName":"Admin", "message":"reply text", "repliedOn":"2017-03-16T18:19:14" },{ "userName":"Commentator", "message":"reply2 text", "repliedOn":"2017-03-16T18:19:14" }]}]" \
-H "authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” 

.NET SDK example

//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
var configuration = new Configuration
{
    AppSid = Sid,
    AppKey = Key
};

var apiInstance = new AnnotationApi(configuration);

try
{
    List annotations = new List();
    AnnotationInfo annotation = new AnnotationInfo
    {
        AnnotationPosition = new Point(852, 154.31),
        Replies = new[]
        {
                      new AnnotationReplyInfo {Message = "reply text", RepliedOn = DateTime.Now, UserName = "Admin"},
                      new AnnotationReplyInfo
                      {
                          Message = "reply2 text",
                          RepliedOn = DateTime.Now,
                          UserName = "Commentator"
                      }
                  },
        Box = new Rectangle((float)173.29, (float)154.31, (float)142.5, 9),
        PageNumber = 0,
        SvgPath =
            "[{\"x\":173.2986,\"y\":687.5769},{\"x\":315.7985,\"y\":687.5769},{\"x\":173.2986,\"y\":678.5769},{\"x\":315.7985,\"y\":678.5769}]",
        Type = AnnotationType.Text,
        CreatorName = "Anonym A."
    };
    annotations.Add(annotation);
    PutExportRequest request = new PutExportRequest()
    {
        Name ="Annotated.pdf",
        Folder=null,
        Password=null,
        Body=annotations,
        
    };
    // Insert/Export annotations to document.
    var response = apiInstance.PutExport(request);
    Debug.Print("Document Processsed and stream length: " + response.Length);

}
catch (Exception e)
{
    Debug.Print("Exception when inserting Annotation to document: " + e.Message);
} 

API Explorer

GroupDocs for Cloud REST APIs comes with a web based API Explorer as well. It is the easiest way to try out our API right away in your browser. It is a collection of Swagger documentation for the GroupDocs Cloud APIs. So simply, first you need to sign up with GroupDocs Cloud, get APP key and SID and start testing GropuDocs.Annotation Cloud Rest API in your favorite browser interactively.

GroupDocs.Annotation Cloud Resources

Following are the links to some useful resources you may need to accomplish your tasks.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the GroupDocs Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by GroupDocs Cloud.