Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Guides

Edit Annotation

You can update the appearance and content of annotations by modifying the properties of annotation objects. The following example demonstrates how to modify annotation properties such as color, transparency, and content:

dart
CPDFPage page = controller.document.pageAtIndex(pageIndex);
var annotations = await page.getAnnotations();
var annotation = annotations[0];
annotation.title = 'ComPDF-Note-A';
annotation.content = 'update note annotation content';
annotation.color = Colors.red;
annotation.alpha = 255;

await controller.document.updateAnnotation(annotation);

For more modifiable properties, please refer to the definition of each annotation class, such as CPDFNoteAnnotation, CPDFMarkupAnnotation, etc.

In addition, we provide an annotation properties panel dialog. You can display the annotation properties editing panel by calling the following API:

dart
await controller.showAnnotationPropertiesView(annotation);