GroupDocs.Annotation for Java is a document annotation API that adds, edits, and removes annotations and markup across many document formats. It provides a unified, format-independent interface to draw area and shape annotations, mark up text with highlights, underlines, strikeouts, and squiggly lines, stamp watermarks, images, and hyperlinks, add editable text fields, and attach threaded review comments — then save the result back to its original format with optional page-range and annotation-type filters.
Quick example
// Add an area annotation to the first page of a PDF
Annotatorannotator=newAnnotator("input.pdf");try{AreaAnnotationarea=newAreaAnnotation();area.setBox(newRectangle(100,100,200,80));// x, y, width, height
area.setPageNumber(0);// 0-based page index
area.setBackgroundColor(65535);// ARGB integer
area.setMessage("Review this section");annotator.add(area);annotator.save("annotated.pdf");}finally{annotator.dispose();}
Features
Shape Annotations: Draw area, ellipse, arrow, point, distance, and polyline annotations with configurable color and opacity.
Text Markup: Highlight, underline, strikeout, and squiggly-mark text, replace or redact text, and redact embedded resources.
Content Annotations: Stamp watermarks, image annotations, hyperlinks, and editable text fields onto a document.
Comments & Replies: Attach threaded review comments to any annotation with user and timestamp information.
Manage Annotations: List, update, and remove annotations — all of them or filtered by annotation type.
Save Filters: Render only selected annotation types or a specific page range when saving the result.
Supported File Formats
GroupDocs.Annotation supports a wide range of file formats. For a complete list, see the full list of supported formats.
For practical code examples covering basic and advanced annotation, see the Basic Usage and Advanced Usage sections. They walk through loading documents, adding every annotation type, attaching comments and replies, listing and removing annotations, and saving results with page-range and annotation-type filters.