Plugin: History
Undo / redo stack for annotation operations.
The History plugin tracks annotation mutations (create, update, delete) on a stack and powers undo / redo.
Enabling flag
The History plugin is always registered. features.undoRedo controls whether undo/redo is surfaced (toolbar buttons + keyboard shortcuts); it auto-enables when features.annotations is on.
What it does
- Pushes a history entry for every annotation create / update / delete
- Undo / Redo toolbar buttons
Ctrl/Cmd + Z/Ctrl/Cmd + Shift + Zkeyboard shortcuts (whenfeatures.keyboardShortcutsis on)- Stack is per-document and cleared when
sourcechanges
Composable
useHistoryCapability() from @embedpdf/plugin-history/vue. DocumentViewer re-exposes undo, redo, canUndo, canRedo on its instance.
Events
None surfaced externally — toolbar state observes canUndo / canRedo reactively.
Dependencies
None — History is registered before Annotation and the Annotation plugin records its mutations into it. (Annotation is the source of the operations History tracks, not the other way around.)
Configuration
No featureConfig.
Scope
Phase 1 history covers annotation mutations only. Document-level operations (zoom changes, page navigation) are not undoable. Phase 2 may extend to redaction-apply and signature-place operations.
When you’d touch it directly
To clear the history (e.g. after loading saved annotations so the load isn’t undoable):
import { useHistoryCapability } from '@embedpdf/plugin-history/vue'
const hist = useHistoryCapability()
hist.provides.value?.clear()