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

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