GroupDocs.Annotation
Add, edit, and remove annotations — comments, highlights, shapes, and stamps — with a single, consistent API across .NET, Java, and Python.
Choose your platform selecting one updates the snippets below
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
Class
Annotator
GroupDocs.Annotation
Method
Annotator.Add
GroupDocs.Annotation
Class
AnnotatorSettings
GroupDocs.Annotation
Class
SaveOptions
Annotation.Options
Class
LoadOptions
Annotation.Options
Class
PreviewOptions
Annotation.Options
Enum
AnnotationType
Annotation.Options
Interface
IDocumentInfo
GroupDocs.Annotation
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
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.