Plugin: Document Manager
Orchestrates document lifecycle — load, switch, and unload PDFs.
The DocumentManager plugin owns the active document. It handles loading a fresh PDF, swapping to a new one when source changes, and unloading on unmount.
Enabling flag
Always registered — required for any PDF rendering. No features flag needed.
What it does
- Wraps the PDFium engine’s document handle for use by other plugins
- Fires the
loadedevent once the PDF is parsed and ready for rendering - Exposes the loaded document via the
useDocumentState(documentId)composable from@embedpdf/core/vue - Coordinates document switching when
sourceprop changes
Composable
useDocumentState(documentId) from @embedpdf/core/vue returns a ComputedRef<DocumentState | null> for the given document id — the reactive core-store state for that document, or null if it isn’t loaded yet.
Events
loaded— first successful document load (surfaces as@document-loadedonDocumentViewer)error— load failure (surfaces as@document-error)
Dependencies
None — this is the foundation.
Configuration
No featureConfig block — DocumentManager has no user-tunable options.
When you’d touch it directly
You shouldn’t need to. DocumentViewer exposes getDocumentInfo() and the document-loaded event for all consumer needs.
See also
- Programmatic API →
getDocumentInfo - Plugin: viewport — what comes next in the pipeline