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' ;
Usage
import { rotatePlugin } from '@react-pdf-viewer/rotate' ;
2. Create the plugin instance
const rotatePluginInstance = rotatePlugin ( ) ;
The plugin instance `rotatePluginInstance` provides the following properties:
Property Type Description From `Rotate``ReactElement`Customizable rotate button 2.0.0 `RotatePage``ReactElement`Rotate a single page 3.2.0 `RotateBackwardButton``ReactElement`The default button to rotate counterclockwise 2.0.0 `RotateBackwardMenuItem``ReactElement`Customizable menu item to rotate counterclockwise 2.0.0 `RotateForwardButton``ReactElement`The default button to rotate clockwise 2.0.0 `RotateForwardMenuItem``ReactElement`Customizable menu item to rotate clockwise 2.0.0
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' ;
Property Type Description From `RotateBackwardIcon``ReactElement`The rotate counterclockwise icon 2.0.0 `RotateForwardIcon``ReactElement`The rotate clockwise icon 2.0.0
See also
Changelog
Add new `RotatePage` component
The `RotateDirection` belongs to the `@react-pdf-viewer/core` package:
import { RotateDirection } from '@react-pdf-viewer/rotate' ;
import { RotateDirection } from '@react-pdf-viewer/core' ;