Subscribing to events
Lifecycle events
ready
Fired when SuperDoc is fully initialized.
editorBeforeCreate
Fired before an editor is created. Use this to configure extensions or set up services.
editorCreate
When an editor is created.
editorDestroy
When an editor is destroyed.
Content events
editor-update
When editor content changes.
content-error
When content processing fails.
fonts-resolved
When document fonts are resolved.
Comments events
comments-update
When comments are modified.
Collaboration events
collaboration-ready
When collaboration is initialized.
awareness-update
When user presence changes.
locked
When document lock state changes.
Pagination events
pagination-update
Fired after each layout pass with the current page count. Use this to know when page data is available — activeEditor.currentTotalPages is only populated after the first layout completes, which happens after the ready event.
UI events
zoomChange
When the zoom level changes via setZoom().
sidebar-toggle
When the comments sidebar is toggled.
Error events
exception
When an error occurs during document processing or runtime.
Configuration-based events
Events can also be set during initialization:Event order
editorBeforeCreate— Before editor mountseditorCreate— Editor readyready— All editors readycollaboration-ready— If collaboration enabledpagination-update— After each layout pass (page count available)- Runtime events (
editor-update,comments-update,sidebar-toggle, etc.) editorDestroy— Cleanup

