Plugin: Rotate
Rotate the document clockwise or counter-clockwise in 90° increments.
The Rotate plugin adds CW / CCW rotation. Every page is re-rendered at the new orientation; the rotation is purely a viewport transform, not a modification to the PDF itself.
Enabling flag
The Rotate plugin is always registered — useRotate is always available. features.rotate controls whether the rotate toolbar group is shown.
What it does
- Toolbar buttons: Rotate CW, Rotate CCW
R(CW) /Shift + R(CCW) keyboard shortcuts (whenfeatures.keyboardShortcutsis on)- Rotates all pages together (no per-page rotation in Phase 1)
- All page layers (render, search, selection, annotations) are wrapped in the
<Rotate>component, so highlights and other overlays rotate together with the page content
Composable
useRotate(documentId) from @embedpdf/plugin-rotate/vue. Returns { rotation, provides }:
{
rotation: Ref<Rotation>, // 0 | 1 | 2 | 3 (×90°)
provides: ComputedRef<RotateScope | null>,
}
The imperative methods live on provides.value:
provides.value?.rotateForward() // clockwise
provides.value?.rotateBackward() // counter-clockwise
provides.value?.setRotation(1) // 0 | 1 | 2 | 3
Events
rotation-change— emits the new rotation in degrees (surfaces as@rotation-changeonDocumentViewer)
Dependencies
- viewport
Configuration
No featureConfig.
When you’d touch it directly
To pre-set a rotation for documents you know are landscape-stored-as-portrait, call provides.value?.setRotation(1) after document-loaded.