<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-annotation-cloud</artifactId>
<version>22.2</version>
</dependency>
compile(group: 'com.groupdocs', name: 'groupdocs-annotation-cloud', version: '22.2')
<dependency org="com.groupdocs" name="groupdocs-annotation-cloud" rev="22.2">
<artifact name="groupdocs-annotation-cloud" ext="jar"/>
</dependency>
libraryDependencies += "com.groupdocs" % "groupdocs-annotation-cloud" % "22.2"
Document Annotation Java Cloud REST API
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free 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.
Cloud Document Annotation Features
- Create & add single or multiple annotations to cloud documents.
- Get description, metadata, and text coordinates of the cloud documents.
- Extract all annotations from a cloud document as a list of
JSON
objects. - Upload the document to the cloud, get it annotated and download.
- Ability to remove all the cloud file annotations in a single go.
- Using cloud document preview create an image representation of all the pages of a cloud document.
- Remove all the pages from the cloud storage to reduce the cloud space consumption.
Supported Types of Cloud Annotations
- Area Annotation: Mark an area using a rectangle on a page within a cloud document
- Distance Annotation: Distance between two points in a straight line marked as an annotation within a cloud document.
- Ellipse Annotation: Mark part of the document with an elliptical annotation.
- Image Annotation: Image overlay annotation to annotate the desired cloud document page content.
- Link Annotation: A hyperlink annotation that is directed to a remote resource.
- Multiple Annotation: Adds multiple annotations to the same cloud document.
- Point Annotation: Adds an annotation note / sticky note to the desired point within the cloud document.
- Polyline Annotation: Annotation that you may draw using shapes or freehand lines.
- Resource Redaction Annotation: A black rectangle with fixed position that you may add to hide / redact any text within a cloud document.
- Squiggly Annotation: Adds a squiggly line under the text to which you want to bring attention.
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
Meta Files: EMF, WMF
Requirements
Building the API client library requires:
- Java 1.7+
- Maven
Prerequisites
To use GroupDocs.Annotation Cloud SDK for Java you need to register an account with GroupDocs Cloud and lookup/create Client ID and Client Secret at Cloud Dashboard. There is free quota available. For more details, see GroupDocs Cloud Pricing.
Install GroupDocs.Annotation-Cloud from Maven
Add GroupDocs Cloud repository to your application pom.xml
<repository>
<id>repository.groupdocs.cloud</id>
<name>repository.groupdocs.cloud</name>
<url>https://repository.groupdocs.cloud/repo/</url>
</repository>
Install from source
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Maven users
Add this dependency to your project’s POM:
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-annotation-cloud</artifactId>
<version>22.2</version>
<type>pom</type>
</dependency>
Others
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/groupdocs-annotation-cloud-22.2.jar
target/lib/*.jar
Get Started
Please follow the Quick Start instructions.
Sample Java Code to Add a Point Annotation
// 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());
Authorization & Authentication
Authentication schemes defined for the API is as follows:
JWT
- Type: OAuth 2.0
- Flow: application
- Authorization URL: https://api.groupdocs.cloud/connect/token
- Token Lifetime: 1 day (Default)
Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial