Java annotation APIs

Insert, modify or delete notes, comments and tags to the document's content using Java document annotation API.

  Download Free Trial
Java document annotation API

GroupDocs.Annotation for Java


GroupDocs.Annotation for Java is a lightweight API that lets you seamlessly enhance your Java app with document viewing and annotation functionality. API supports Microsoft Word DOCX, Excel XLSX, PowerPoint PPTX and PDF documents currently. Image formats will be available soon. Consuming API, you can enable end users to view, annotate, share and print both types of documents from within your Java app.

Advanced Java Document Annotation API Features



Easy Integration


Native Word & PDF Annotations


Works across All Major Platforms


Comprehensive Set of Annotation Tools


Annotate Email : Ability to annotate Email documents (export only)


Annotate HTML : Ability to annotate HTML documents


Annotate Images : Annotate numerous image formats like JPG, TIFF, CAD,DjVu


File IO though Java stream for reading and getting document information


Cross-Platform Compatibility


Real-Time Annotation


Flexible Options to Store Annotation Objects

Support for Native Word & PDF Annotations

Java annotation API has ability to export annotated PDF and Word documents complete with annotations for offline review and editing. PDF annotations, in turn, can be imported to GroupDocs for online review, markup and commenting.

Comprehensive Set of Annotation Tools

  • Area annotation – add notes to an area selected with a rectangle.
  • Point annotation – add notes to any point in the document.
  • Text annotation – add notes to selected text.

Add text annotation - Java

 // Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new ArrayList<AnnotationInfo>();
 // Initialize text annotation
AnnotationInfo textAnnotation = new AnnotationInfo();
textAnnotation.setBox(new Rectangle(68, 154, 102, 9)); 
// Add annotation to the document
InputStream result = annotator.exportAnnotationsToDocument(cleanPdf, annotations, DocumentType.Pdf);
// Save result stream to file
OutputStream fileStream = new FileOutputStream(Utilities.outputPath + File.separator + "annotated-text.pdf");
IOUtils.copy(result, fileStream);
  • Strikeout/underline - mark up text with strikethroughs/underlines.
  • Text replacement - type text to replace existing one.
  • Area redaction - blackout selected area.
  • Text redaction - blackout selected text.
  • Polyline - draw freehand lines and shapes.
  • Pointer/arrow - drop arrows with notes.
  • Watermark - add watermarks.

Real-Time Annotation

Thanks to the real-time annotation feature, several users can review and annotate the same document simultaneously. Invited parties can see each others' comments and markup in real-time, which delivers the fastest feedback possible and unmatched experience when collaborating on documents.

Flexible Options to Store Annotation Objects

Markup and comments in GroupDocs.Annotation are created and rendered in a separate layer on top of the displayed documents, while the original files are kept unchanged. Annotations can be stored in any DB supported with the ORMLite (persistence) API. No matter what the initial document’s format is, annotations can be merged with the original file and exported to a final PDF document.

Cross-Platform Compatibility

Breaking through platform incompatibilities, GroupDocs.Annotation allows end users to view and annotate documents from any web-enabled device, including tablets and mobiles. Supported browsers include: IE (8+), Firefox, Chrome, Opera, Safari 5+ and their mobile versions:

Supported Browsers
  • IE8+
  • Chrome
  • Chrome for Android
  • Firefox
  • Firefox for Android
  • Opera
  • Opera Mini
  • Opera for Android
  • Safari 5+
  • Mobile Safari
Supported Devices
  • iPhone
  • iPad
  • Android
  • PC
  • Mac

Installation and Usage

GroupDocs.Annotation for Java API files can be downloaded directly from:

Fat version
    • Download API from the download archive.
    • Extract the archive.
    • Open console and cd to lib directory of the extracted directory.
    • Run the install_library.bat to install API in maven

Note: version number and file name can be different from current documentation.

  • Add dependency to your pom.xml
Slim version

This API is hosted in the Maven Central Repository, so if you use Maven in your projects just use the dependency declaration provided above.

The jar itself you can download from the Maven Central Repository.

Another way to use.

All it takes to start rolling with GroupDocs.Annotation is to reference a single GroupDocs.Annotation.jar file..

If you download the Zip Archive as discussed in the Fat version then you are required to add the external API by practicing the following steps in Eclipse::

  • Right click on Java project, and go to Properties..
  • Go to Java Build Path.
  • Open Libraries tab.
  • Press Add External JARs.., and load GroupDocs.Annotation Jar.

Support and Learning Resources


GroupDocs.Annotation offers document automation APIs for other popular development environments as listed below: