Rotate plugin

The rotate plugin provides buttons to rotate the document clockwise or counterclockwise. They come with the default styles and provide the ability of customization.

Install

npm install '@react-pdf-viewer/rotate';
The rotate plugin is included in the toolbar and default-layout plugins

Usage

1. Import the plugin
import { rotatePlugin } from '@react-pdf-viewer/rotate';
2. Create the plugin instance
const rotatePluginInstance = rotatePlugin();
The plugin instance rotatePluginInstance provides the following properties:
PropertyTypeDescriptionFrom
RotateReactElementCustomizable rotate button2.0.0
RotateBackwardButtonReactElementThe default button to rotate counterclockwise2.0.0
RotateBackwardMenuItemReactElementCustomizable menu item to rotate counterclockwise2.0.0
RotateForwardButtonReactElementThe default button to rotate clockwise2.0.0
RotateForwardMenuItemReactElementCustomizable menu item to rotate clockwise2.0.0
3. Register the plugin
Register the rotate plugin instance:
<Viewer plugins={[rotatePluginInstance]} />

Properties

The rotate plugin provides other useful properties as following:
import { RotateBackwardIcon, RotateForwardIcon } from '@react-pdf-viewer/rotate';
PropertyTypeDescriptionFrom
RotateBackwardIconReactElementThe rotate counterclockwise icon2.0.0
RotateForwardIconReactElementThe rotate clockwise icon2.0.0

See also

Changelog

v2.0.0
  • First release