Skip to main content
Use a ref to access the SuperDoc instance and call methods programmatically.

Ref API

getInstance()

Returns the underlying SuperDoc instance, or null before the editor is ready.
Use optional chaining (?.) for safe access — getInstance() returns null until onReady fires.

Available instance methods

Once you have the SuperDoc instance, you can call any SuperDoc method:

Common patterns

PDF setup

Use pdfjs-dist with modules.pdf for predictable PDF rendering.
Use document.data for local File/Blob and document.url for remote URLs.

Whiteboard stickers (PDF)

Register stickers when the whiteboard instance is available and pass the sticker id via application/sticker.
For drop placement, switch whiteboard to select mode before dragging stickers.

Search and navigate

Export to HTML

Real-time collaboration

Collaboration guide

Full setup for real-time collaboration