Plugin: Pan
Hand-tool interaction mode for drag-to-pan when zoomed in.
The Pan plugin adds a hand-tool toggle that switches the viewport between text-select mode (default) and pan mode (drag the page around).
Enabling flag
The Pan plugin is always registered — usePan is always available. features.pan controls whether the hand-tool toolbar toggle is shown.
The interaction-manager plugin (which bridges pointer events to the pan handler) is also always registered.
What it does
- Toolbar toggle: switch between hand (pan) and text (select) interaction modes
- In pan mode, dragging on a page moves the viewport
- Coexists with
features.selection— the toggle decides which mode is active
Composable
usePan(documentId) from @embedpdf/plugin-pan/vue. Returns { isPanning, provides }:
{
isPanning: Ref<boolean>,
provides: ComputedRef<PanScope | null>,
}
The mode-toggle methods live on provides.value:
provides.value?.enablePan()
provides.value?.disablePan()
provides.value?.togglePan()
Events
interaction-mode-change— emits{ mode: 'hand' | 'text' }(surfaces as@interaction-mode-changeonDocumentViewer)
Dependencies
- viewport
- interaction-manager (always registered)
Configuration
No featureConfig.
When you’d touch it directly
For PDFs that are mostly images (scans, plans), default to pan mode for a smoother experience.