<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-annotation-cloud</artifactId>
<version>23.12</version>
</dependency>
copied!  
compile(group: 'com.groupdocs', name: 'groupdocs-annotation-cloud', version: '23.12')
copied!  
<dependency org="com.groupdocs" name="groupdocs-annotation-cloud" rev="23.12">
 <artifact name="groupdocs-annotation-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.groupdocs" % "groupdocs-annotation-cloud" % "23.12"
copied!  

Document Annotation Java Cloud REST API

main-banner

Product Docs Demos Swagger UI Samples Blog Support Trial

GroupDocs.Annotation Cloud SDK for Java helps you build cloud Document Annotator Java Apps that work without installing any 3rd party software. It is a wrapper around GroupDocs.Annotation Cloud REST APIs.

Document Annotation Features

  • Add single or multiple annotations to cloud documents.
  • Add annotations directly to documents stored in the cloud.
  • Support for various annotation types including text, images, and shapes.
  • Customize annotation properties such as color, size, and position.
  • Annotate multiple document formats like PDF, Word, Excel, PowerPoint, and images.

Document Management Features

  • Rendering Documents: Convert documents into formats like PDF, images, or HTML for viewing or printing.
  • Preview Document: Generate image representations of document pages for preview purposes.
  • Remove Annotations: Delete specific annotations or remove all annotations from a document.
  • Extract Annotations: Retrieve all annotations from a document as a list of JSON objects.

File & Storage Management

  • Working with File API: Upload, download, copy, move, and delete files in cloud storage.
  • Working with Folder API: Organize and manage folders in cloud storage (create, move, delete).
  • Working with Storage API: Access and manage cloud storage resources, including retrieving storage details and file information.
  • Get Supported File Formats: Retrieve a list of supported file formats for annotations.
  • File Info: Obtain detailed information about files in the cloud, such as size, format, and metadata.

Document Information & Processing

  • Get Document Information: Retrieve detailed document information, including metadata, text content, and annotations.
  • Get Pages: Access the list of pages in a document along with details like size and orientation.
  • Annotation Info: Access detailed information about annotations, including type, position, and content.
  • Annotation Options: Configure various annotation options, including page selection, position, and styling.
  • Advanced Usage: Utilize advanced features for managing annotations, such as grouping and ordering.

Supported Types of Annotations

API Specific Features

  • Add Annotations Directly: Add annotations to documents without downloading them.
  • Public API Examples: Access sample code and documentation for utilizing the API features.

Supported Cloud Annotation Document Formats

  • Microsoft Word®: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT
  • OpenOffice Writer®: ODT, OTT
  • Microsoft Excel®: XLS, XLSX, XLSB
  • Microsoft PowerPoint®: PPT, PPTX, PPSX
  • OpenOffice Impress®: ODP, OTP
  • Microsoft Visio®: VSD, VDX, VSS, VSDM
  • Microsoft Outlook®: MSG, EML, EMLX
  • AutoCAD®: CAD
  • Images: DJVU, JPEG, TIFF, BMP, GIF (static images without animation)
  • Medical Imaging: DICOM
  • Markup: HTML, MHTML
  • Fixed Layout: PDF
  • MetaFiles: EMF, WMF

Requirements

  • Java Version: Building the API client library requires Java 1.7+.
  • Build Tool: Maven is required to manage dependencies and build the project.

Prerequisites

  • GroupDocs Cloud Account: To use GroupDocs.Annotation Cloud SDK for Java, you need to register an account with GroupDocs Cloud.
  • Client ID & Client Secret: After registering, you need to lookup or create your Client ID and Client Secret on the Cloud Dashboard.
  • Free Quota: GroupDocs Cloud offers a free quota for new users. For more details, you should check the GroupDocs Cloud Pricing.

Install GroupDocs.Annotation-Cloud from Maven

To install the GroupDocs.Annotation Cloud SDK for Java, you need to add the GroupDocs Cloud repository to your application’s pom.xml file:

<repository>
    <id>repository.groupdocs.cloud</id>
    <name>repository.groupdocs.cloud</name>
    <url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>

Install from Source

To install the API client library from the source code, follow these steps:

  • Install to Local Maven Repository: To install the library to your local Maven repository, simply execute the following command in the terminal:
mvn clean install
  • Deploy to Remote Maven Repository: If you wish to deploy it to a remote Maven repository, configure the repository settings and execute the following command:
mvn clean deploy

For more details on deploying to a remote repository, refer to the OSSRH Guide.

Maven Users

If you are a Maven user, you can add the GroupDocs.Annotation Cloud SDK for Java as a dependency in your project’s pom.xml file:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-annotation-cloud</artifactId>
    <version>22.2</version>
    <type>pom</type>
</dependency>

Get Started

To get started with GroupDocs.Annotation Cloud SDK for Java, follow these steps:

  1. Install SDK: Install the SDK by following the steps outlined above (using Maven or installing from source).
  2. Configuration: Set up the configuration using your Client ID and Client Secret obtained from the GroupDocs Cloud Dashboard.
  3. Sample Code: Implement sample code in your application to add annotations, extract document information, or manage files and folders.
  4. Documentation: Refer to the Quick Start instructions and API documentation for detailed usage examples and additional information.

Authorization & Authentication

GroupDocs.Annotation Cloud SDK for Java uses OAuth 2.0 for authorization and authentication. The following details are provided:

  • Authorization Type: OAuth 2.0
  • Flow: Application-based authorization
  • Authorization URL: https://api.groupdocs.cloud/connect/token
  • Token Lifetime: 1 day (by default)

JWT

GroupDocs.Annotation Cloud SDK uses JSON Web Tokens (JWT) for secure API access:

  • Token Type: OAuth 2.0 JWT (JSON Web Token)
  • Authorization URL: Tokens are generated using the https://api.groupdocs.cloud/connect/token endpoint.
  • Token Expiry: The default token lifetime is 1 day, ensuring secure, time-bound access to the API.

These details provide a comprehensive guide to setting up and using GroupDocs.Annotation Cloud SDK for Java, covering the essential requirements, installation steps, and security configurations.

Here are two of the most sellable code snippets extracted from the provided content. These snippets showcase essential functionality that would appeal to potential users looking to integrate annotation capabilities into their applications.

Sample Cloud Java Code to Add a Point Annotation

This snippet demonstrates how to add a point annotation to a document using the GroupDocs.Annotation Cloud SDK for Java. Point annotations are useful for marking specific points in a document with comments or notes.

// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-java-samples
String MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
String MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud

Configuration configuration = new Configuration(MyAppSid, MyAppKey);
AnnotateApi apiInstance = new AnnotateApi(configuration);

// Create annotation/s.
AnnotationInfo[] annotations = new AnnotationInfo[1];
annotations[0] = new AnnotationInfo();

Point pt = new Point();
pt.setX(1.0);
pt.setY(1.0);
annotations[0].setAnnotationPosition(pt);

Rectangle r = new Rectangle();
r.setX(100.0);
r.setY(100.0);
r.setWidth(200.0);
r.setHeight(100.0);

annotations[0].setBox(r);
annotations[0].setPageNumber(0);
annotations[0].setType(TypeEnum.POINT);
annotations[0].setText("This is point annotation");
annotations[0].setCreatorName("Anonym A.");

// Create request object.
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("Annotationdocs\\one-page.docx");

AnnotateOptions options = new AnnotateOptions();
options.setFileInfo(fileInfo);
options.setAnnotations(Arrays.asList(annotations));
options.setOutputPath("Output/one-page-annotated.docx");

AnnotateRequest request = new AnnotateRequest(options);

// Executing api method.
AnnotationApiLink result = apiInstance.annotate(request);
System.out.println("AddPointAnnotation: Point Annotation added: " + result.getTitle());

Sample Cloud Java Code to Add a TextHighlight Annotation

This code snippet shows how to add a text highlight annotation to a document. Highlighting text is a common annotation task, especially in review processes, and this snippet illustrates how it can be done programmatically.

// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-java-samples
String MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
String MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud

Configuration configuration = new Configuration(MyAppSid, MyAppKey);
AnnotateApi apiInstance = new AnnotateApi(configuration);

// Create annotation/s.
AnnotationInfo[] annotations = new AnnotationInfo[1];
annotations[0] = new AnnotationInfo();

Rectangle r = new Rectangle();
r.setX(100.0);
r.setY(100.0);
r.setWidth(300.0);
r.setHeight(50.0);

annotations[0].setBox(r);
annotations[0].setPageNumber(0);
annotations[0].setType(TypeEnum.TEXT_HIGHLIGHT);
annotations[0].setText("This text is highlighted");
annotations[0].setCreatorName("Anonym A.");

// Create request object.
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("Annotationdocs\\sample.docx");

AnnotateOptions options = new AnnotateOptions();
options.setFileInfo(fileInfo);
options.setAnnotations(Arrays.asList(annotations));
options.setOutputPath("Output/sample-annotated.docx");

AnnotateRequest request = new AnnotateRequest(options);

// Executing api method.
AnnotationApiLink result = apiInstance.annotate(request);
System.out.println("AddTextHighlightAnnotation: Text Highlight Annotation added: " + result.getTitle());

Product Docs Demos Swagger UI Samples Blog Support Trial

VersionRelease Date
23.12December 27, 2023
23.4April 14, 2023
22.2February 7, 2022
21.6January 25, 2022
21.2January 25, 2022
18.7January 25, 2022
18.4January 25, 2022
20.10October 14, 2020
19.5May 15, 2019