Plugin: Hotkeys
Keyboard shortcuts for navigation, zoom, panels, and search.
The Hotkeys plugin wires keyboard shortcuts that mirror desktop PDF reader conventions.
Enabling flag
features.keyboardShortcuts: true
Bindings
| Shortcut | Action |
|---|---|
← / → | Previous / next page |
Home / End | First / last page |
+ / = / - / _ | Zoom in / out |
0 | Reset zoom (fit page) |
R | Rotate CW |
Shift + R | Rotate CCW |
Ctrl/Cmd + F | Open search popover |
Esc | Close search / panel / popover |
F11 | Toggle fullscreen |
Ctrl/Cmd + Z | Undo (requires features.undoRedo) |
Ctrl/Cmd + Shift + Z / Ctrl/Cmd + Y | Redo |
C | Toggle comments panel |
O | Toggle outline panel |
T | Toggle thumbnails panel |
Bindings only fire when the focus is inside the viewer (so they don’t fight with the host app’s shortcuts).
How it works
Keyboard shortcuts are built on the EmbedPDF Commands plugin (@embedpdf/plugin-commands), not a dedicated hotkeys plugin. DocumentViewer registers a command catalog (each command carries its shortcuts and an action) via the Commands plugin, then a small internal keyboard bridge maps DOM key events to the matching command. features.keyboardShortcuts toggles that bridge.
Composable
useCommandsCapability() from @embedpdf/plugin-commands/vue exposes the command registry. The viewer wires the catalog and the keyboard bridge internally.
Events
None surfaced externally — bindings invoke the same imperative methods as the toolbar.
Dependencies
- Commands plugin (
@embedpdf/plugin-commands)
Configuration
No featureConfig. To add your own shortcut, register a command (which carries its own shortcuts) via the Commands capability:
import { useCommandsCapability } from '@embedpdf/plugin-commands/vue'
const commands = useCommandsCapability()
commands.provides.value?.registerCommand({
id: 'app.save',
label: 'Save to backend',
shortcuts: ['ctrl+s', 'meta+s'],
action: () => saveToBackend(),
})