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);