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

Overview

Use events and notifications to synchronize application state, trigger custom workflows, or replace selected built-in UI behaviors.

The Flutter SDK exposes events in two ways:

  • Reader callbacks: Pass callbacks directly to CPDFReaderWidget when creating the reader. Use these for reader lifecycle, viewer UI, style dialog, custom menu, annotation action, and form widget action callbacks.
  • Listener events: Register events with CPDFReaderWidgetController.addEventListener() after the reader is created. Use these for annotation, form, and content editor object lifecycle events.

Event Summary

CategoryAPITrigger Timing
VieweronPageChangedCurrent page changes
VieweronSaveCallbackDocument save completes
VieweronFillScreenChangedFullscreen state changes
VieweronTapMainDocAreaCallbackMain PDF page area is tapped
VieweronPageEditDialogBackPressBack button in page edit dialog is tapped
VieweronIOSClickBackPressediOS top-left reader back button is tapped
VieweronSearchBackButtonTappedCallbackSearch view back button is tapped
VieweronAddWatermarkDialogDismissedCallbackAdd watermark dialog is dismissed
AnnotationsonAnnotationCreationPreparedCallbackSignature, stamp, link, image, or Note creation is prepared
AnnotationsonAnnotationStyleDialogDismissedCallbackAnnotation style dialog is dismissed
AnnotationsonInterceptAnnotationActionCallbackExisting Note or Link annotation is tapped and interception is enabled
AnnotationsCPDFEvent.annotationsCreatedAnnotation is created
AnnotationsCPDFEvent.annotationsSelectedAnnotation is selected
AnnotationsCPDFEvent.annotationsDeselectedAnnotation is deselected
AnnotationsCPDFEvent.pencilDrawingCompletediOS Pencil drawing is completed
AnnotationsCPDFEvent.pencilDrawingDiscardediOS Pencil drawing is discarded
FormsonFormStyleDialogDismissedCallbackForm style dialog is dismissed
FormsonInterceptWidgetActionCallbackA configured form widget is tapped and interception is enabled
FormsCPDFEvent.formFieldsCreatedForm field is created
FormsCPDFEvent.formFieldsSelectedForm field is selected
FormsCPDFEvent.formFieldsDeselectedForm field is deselected
Content EditoronContentEditorStyleDialogDismissedCallbackContent editor style dialog is dismissed
Content EditorCPDFEvent.editorSelectionSelectedEditable content is selected
Content EditorCPDFEvent.editorSelectionDeselectedEditable content is deselected
Custom Context MenuonCustomContextMenuItemTappedCallbackCustom context menu item is tapped
Custom Toolbar MenuonCustomToolbarItemTappedCallbackCustom toolbar item is tapped

Guides

Viewer Listen to page changes, document saves, fullscreen toggles, back button clicks, and related viewer UI events.

Annotations Listen to annotation creation, style dialog, action interception, selection, and iOS Pencil drawing events.

Forms Listen to form field style dialog, creation, selection, and deselection events.

Content Editor Listen to content editor style dialog and editable content selection events.

Custom Context Menu Listen to custom context menu item tap events.

Custom Toolbar Menu Listen to custom top toolbar menu item tap events.

Custom Note Annotation Creation Dialog Disable the default Note edit dialog after creation and present your own Flutter editing UI.