Skip to content
ComPDF
Guides

Annotation Visibility

You can use CPDFConfiguration or CPDFReaderWidgetController to show or hide annotations in the current document.

The following are examples of how to show or hide annotations:

  • Show or hide annotations using CPDFConfiguration
dart
CPDFReaderWidget(
  document: widget.documentPath,
  configuration: CPDFConfiguration(
    readerViewConfig: CPDFReaderViewConfig(annotationsVisible: true)
  )
);
  • Show or hide annotations using CPDFReaderWidgetController
dart
// Check if annotations are currently visible
bool isAnnotationsVisible = await _controller.isAnnotationsVisible();
// Show annotations
await _controller.setAnnotationsVisible(true);
// Hide annotations
await _controller.setAnnotationsVisible(false);