Working with Annotations

Introduction

GroupDocs.Annotation Cloud API provides annotation data from supported file formats as AnnotationInfo Object.

AnnotationInfo object fields

Field NameTypeDescription
guidstringThe unique identifier of annotation.
documentGuidlongThe unique identifier of document.
textstringThe text of the annotation.
creatorGuidstringThe annotation creator unique identifier.
creatorNamestringThe annotation creator name.
creatorEmailstringThe annotation creator email.
boxRectangleThe frame of the annotation.
pageNumberintThe annotation page number.
annotationPositionPointCoordinates of annotation point or row and column for cells document.
svgPathstringThe annotation svg-path.
typeAnnotationTypeThe annotation type.Enum that represents all types of annotations.
accessAnnotationAccessThe annotation access.
repliesAnnotationReplyInfo[]The list of annotation replies.
createdOnDateTimeThe annotation creation date.
fontColorintThe annotaiton text font color.
penColorintThe annotaiton pen color.
penWidthbyteThe annotaiton pen width.
penStylebyteThe annotaiton pen style.
backgroundColorintThe annotaiton background color.
fieldTextstringThe annotaiton text font color.
fontFamilystringThe annotaiton text font family.
fontSizedoubleThe annotaiton text font size.

Point object fields

Field NameTypeDescription
xDoubleThe x coordinate.
yDoubleThe y coordinate.

AnnotationReplyInfo object fields

Field NameTypeDescription
GuidstringThe unique identifier of reply.
UserGuidstringThe unique identifier of user.
UserNamestringThe user name.
UserEmailstringThe user email.
MessagestringThe reply message.
RepliedOnDateTimeThe reply creation date.
ParentReplyGuidstringThe unique identifier of parent reply.

Rectangle object fields

Field NameTypeDescription
xfloatThe x coordinate.
yfloatThe y coordinate.
widthfloatThe rectangle width.
heightfloatThe rectangle height.

The emuneration of Annotation types

public enum AnnotationType : byte
{
   /// The text
   Text = 0,
   /// The area
   Area = 1,
   /// The point
   Point = 2,
   /// The text strikeout
   TextStrikeout = 3,
   /// The polyline
   Polyline = 4,
   /// The text field
   TextField = 5,
   /// The watermark
   Watermark = 6,
   /// The text replacement
   TextReplacement = 7,
   /// The arrow
   Arrow = 8,
   /// The text redaction
   TextRedaction = 9,
   /// The resources redaction
   ResourcesRedaction = 10,
   /// The text underline
   TextUnderline = 11,
   /// The distance
   Distance = 12
}

Import Annotation Information

This API retrieves(imports) annotation information from the document. It returns the list of annotations which were imported from the document.

Resource

The following GroupDocs.Annotation Cloud REST API resource has been used to get annotation list from document.

cURL REST Example

curl -v "https://api.groupdocs.cloud/v1/annotation/Annotated.pdf/annotations" \
-X GET \
-H "Content-Type: application/json" \
-H "authorization: Bearer 0v7TK3UGYjVBEcEIS9aaO0dsXAlt-KriIDnJGkDIPktFmuu6xIuou2-eVUD4-Td9TcToDvShk9w02pWIXvyEdstxDqjSa8L2K4Pk2zgNkAoEDgDeFlpWf0k7lZ8guqUm43eAKQf43MVNyr3L6P3w1e2l9j-RJx-btpPorcZ90xY8S_b1vySsKsUxOlnwYtWc01JEXlO7TNrmfD3Eek4ch-xzi-qe4V8nofmy7RbqwHNczeP7O_9bMi1eQ68b3Rprqd4UvDCj3gqTMyAaqd-I58lJzZsHRnbZoM7icIjVQyu02bRgx7meoXB8fIWmOkUfUkiGTT3IjI4NSmARxrPPwgp2LAv-N_9H0q3nxxfZDV1vHZQP--I6vgC2UHo-YPw-mB4WRVHsUKqq04L4pdR4pCIWuluus_ydjVH_ndJlqP843eL3glt1XJez3DgXQIbHiAnqBBDqZqSZZDVUYhLDq1jN9eM"
[  
   {  
      "guid":null,
      "documentGuid":0,
      "text":null,
      "creatorGuid":null,
      "creatorName":"Anonym A.",
      "creatorEmail":null,
      "box":{  
         "x":173.0,
         "y":154.89,
         "width":142.5,
         "height":9.0
      },
      "pageNumber":0,
      "annotationPosition":{  
         "x":173.0,
         "y":154.8
      },
      "svgPath":"[
      {
        \"X\":173.298,
        \"Y\":687.575
      },
      {
        \"X\":315.798,
        \"Y\":687.576
      },
      {
        \"X\":173.298,
        \"Y\":678.576
      },
      {
        \"X\":315.793,
        \"Y\":678.875
       }
      ]",
      "type":0,
"access":null,
"replies":[  
   {  
      "guid":null,
      "userGuid":null,
      "userName":"Admin",
      "userEmail":null,
      "message":"reply text",
      "repliedOn":"2017-03-16T18:19:14",
      "parentReplyGuid":null
   },
   {  
      "guid":null,
      "userGuid":null,
      "userName":"Commentator",
      "userEmail":null,
      "message":"reply2 text",
      "repliedOn":"2017-03-16T18:19:14",
      "parentReplyGuid":null
   }
]

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Import Annotation Information

Export Annotation

This API adds(exports) annotation to a document and retrieves the resultant document as stream. It expects AnnotaitonInfo object in request body.

Resource

The following GroupDocs.Annotation Cloud REST API resource has been used to add Annotation and get resultant document as stream.

cURL REST Example

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 0v7TK3UGYjVBEcEIS9aaO0dsXAlt-KriIDnJGkDIPktFmuu6xIuou2-eVUD4-Td9TcToDvShk9w02pWIXvyEdstxDqjSa8L2K4Pk2zgNkAoEDgDeFlpWf0k7lZ8guqUm43eAKQf43MVNyr3L6P3w1e2l9j-RJx-btpPorcZ90xY8S_b1vySsKsUxOlnwYtWc01JEXlO7TNrmfD3Eek4ch-xzi-qe4V8nofmy7RbqwHNczeP7O_9bMi1eQ68b3Rprqd4UvDCj3gqTMyAaqd-I58lJzZsHRnbZoM7icIjVQyu02bRgx7meoXB8fIWmOkUfUkiGTT3IjI4NSmARxrPPwgp2LAv-N_9H0q3nxxfZDV1vHZQP--I6vgC2UHo-YPw-mB4WRVHsUKqq04L4pdR4pCIWuluus_ydjVH_ndJlqP843eL3glt1XJez3DgXQIbHiAnqBBDqZqSZZDVUYhLDq1jN9eM"
Returns Binary data

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Export Annotation and get Document as Stream

Remove Annotation

This API removes annotation from a document and retrieves the resultant document as stream.

Resource

The following GroupDocs.Annotation Cloud REST API resource has been used to remove Annotation and get resultant document as stream.

cURL REST Example

curl -v "https://api.groupdocs.cloud/v1/annotation/Annotated.pdf/annotations" \
-X DELETE \
-H "Content-Type: application/json" \
-H "authorization: Bearer 0v7TK3UGYjVBEcEIS9aaO0dsXAlt-KriIDnJGkDIPktFmuu6xIuou2-eVUD4-Td9TcToDvShk9w02pWIXvyEdstxDqjSa8L2K4Pk2zgNkAoEDgDeFlpWf0k7lZ8guqUm43eAKQf43MVNyr3L6P3w1e2l9j-RJx-btpPorcZ90xY8S_b1vySsKsUxOlnwYtWc01JEXlO7TNrmfD3Eek4ch-xzi-qe4V8nofmy7RbqwHNczeP7O_9bMi1eQ68b3Rprqd4UvDCj3gqTMyAaqd-I58lJzZsHRnbZoM7icIjVQyu02bRgx7meoXB8fIWmOkUfUkiGTT3IjI4NSmARxrPPwgp2LAv-N_9H0q3nxxfZDV1vHZQP--I6vgC2UHo-YPw-mB4WRVHsUKqq04L4pdR4pCIWuluus_ydjVH_ndJlqP843eL3glt1XJez3DgXQIbHiAnqBBDqZqSZZDVUYhLDq1jN9eM"
Returns Binary data

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Remove Annotation and get Document as Stream