GroupDocs.Annotation

Add, edit, and remove annotations — comments, highlights, shapes, and stamps — with a single, consistent API across .NET, Java, and Python.

3 platforms 30+ formats Latest v26.6.0

Choose your platform selecting one updates the snippets below

.NETv26.6.0
dotnet add package GroupDocs.Annotation
Javav25.6.0
com.groupdocs:groupdocs-annotation
Python via .NET
pip install groupdocs-annotation-net

Getting started with .NET

using GroupDocs.Annotation;
using GroupDocs.Annotation.Models;
using GroupDocs.Annotation.Models.AnnotationModels;

// Open the file with an Annotator instance
using (Annotator annotator = new Annotator("input.pdf"))
{
    // Create and configure an annotation
    AreaAnnotation area = new AreaAnnotation
    {
        Box = new Rectangle(100, 100, 200, 80),
        BackgroundColor = 65535,
        PageNumber = 0,
        Message = "Review this section"
    };

    // Add the annotation to the document
    annotator.Add(area);

    // Save the annotated file
    annotator.Save("annotated.pdf");
}
import com.groupdocs.annotation.Annotator;
import com.groupdocs.annotation.models.Rectangle;
import com.groupdocs.annotation.models.annotationmodels.AreaAnnotation;

// Load your source file with an Annotator instance
Annotator annotator = new Annotator("input.pdf");
try {
    // Create and configure an annotation
    AreaAnnotation area = new AreaAnnotation();
    area.setBox(new Rectangle(100, 100, 200, 80));
    area.setBackgroundColor(65535);
    area.setPageNumber(0);
    area.setMessage("Review this section");

    // Add the annotation to the document
    annotator.add(area);

    // Save the file with annotations applied
    annotator.save("annotated.pdf");
} finally {
    annotator.dispose();
}
from groupdocs.annotation import Annotator
from groupdocs.annotation.models import Rectangle
from groupdocs.annotation.models.annotation_models import AreaAnnotation
from groupdocs.pydrawing import Color

# Open your file with an Annotator instance
with Annotator("input.pdf") as annotator:
    # Create and configure an annotation
    area = AreaAnnotation()
    area.box = Rectangle(100, 100, 200, 80)
    area.background_color = Color.yellow.to_argb()
    area.page_number = 0
    area.message = "Review this section"

    # Add the annotation to the document
    annotator.add(area)

    # Save the annotated file
    annotator.save("annotated.pdf")

Popular classes & namespaces

Key capabilities

  • Text markup & comments
  • Highlight, underline, strikeout
  • Shapes, arrows & areas
  • Image stamps & watermarks
  • Import / export annotations
  • Render annotated previews

Supported formats

PDFWordExcelPowerPointImagesCAD

…and 20+ more document, image, and CAD formats.

Resources