<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-annotation-cloud</artifactId>
<version>23.12</version>
</dependency>
compile(group: 'com.groupdocs', name: 'groupdocs-annotation-cloud', version: '23.12')
<dependency org="com.groupdocs" name="groupdocs-annotation-cloud" rev="23.12">
<artifact name="groupdocs-annotation-cloud" ext="jar"/>
</dependency>
libraryDependencies += "com.groupdocs" % "groupdocs-annotation-cloud" % "23.12"
Document Annotation Java Cloud REST API
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
- Area Annotation: Highlight and annotate a specific rectangular area within a cloud document.
- Arrow Annotation: Draw an arrow to point out specific content on the cloud document page.
- Distance Annotation: Measure and annotate the distance between two objects or points in a cloud document.
- Ellipse Annotation: Use an elliptical shape to highlight and annotate specific content in a document.
- Image Annotation: Overlay an image as an annotation on top of the document content.
- Link Annotation: Add a hyperlink annotation that links to an external resource.
- Point Annotation: Place a note at a specific point within the document for detailed annotation.
- Polyline Annotation: Draw freehand lines or shapes to annotate and highlight content.
- Resources Redaction Annotation: Redact sensitive text by covering it with a black rectangle.
- TextField Annotation: Add a text comment within a colored frame as an annotation.
- TextHighlight Annotation: Highlight text and add comments to draw attention to specific content.
- TextRedaction Annotation: Hide selected text with a black rectangle for redaction.
- TextReplacement Annotation: Replace original text with a new fragment through annotation.
- TextStrikeout Annotation: Mark text with a strike-through to indicate deletion.
- TextUnderline Annotation: Underline and annotate text for emphasis.
- Watermark Annotation: Add a watermark text annotation over the document.
- Squiggly Annotation: Use a squiggly line to underline and draw attention to text.
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:
- Install SDK: Install the SDK by following the steps outlined above (using Maven or installing from source).
- Configuration: Set up the configuration using your Client ID and Client Secret obtained from the GroupDocs Cloud Dashboard.
- Sample Code: Implement sample code in your application to add annotations, extract document information, or manage files and folders.
- 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());
Document Annotation Java Cloud REST API GroupDocs.Annotation SDK API Document Management Cloud REST API Document Annotation Java SDK Cloud Document Annotator Annotation Types Text Annotations Image Annotations Shape Annotations Annotation Properties PDF Annotation Word Annotation Excel Annotation PowerPoint Annotation Image Annotation Rendering Documents Preview Documents Remove Annotations Extract Annotations File Management Folder Management Storage Management File API Folder API Storage API Supported File Formats Document Information Get Pages Annotation Info Annotation Options Advanced Annotation Usage Area Annotation Arrow Annotation Distance Annotation Ellipse Annotation Link Annotation Point Annotation Polyline Annotation Resources Redaction Annotation TextField Annotation TextHighlight Annotation TextRedaction Annotation TextReplacement Annotation TextStrikeout Annotation TextUnderline Annotation Watermark Annotation Squiggly Annotation Microsoft Word OpenOffice Writer Microsoft Excel Microsoft PowerPoint OpenOffice Impress Microsoft Visio Microsoft Outlook AutoCAD DICOM HTML MHTML PDF MetaFiles Maven Install from Source JWT OAuth 2.0 Authorization Authentication Sample Code Java Examples Get Started Client ID Client Secret GroupDocs Cloud Cloud Storage Deploy to Maven Install SDK API Configuration