Skip to content

Rotate plugin

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

Install

> npm install @sse-ui/pdf-rotate;

OR

> yarn add @sse-ui/pdf-rotate;

The rotate plugin is included in the toolbar and default-layout plugins

Usage

1. Import the plugin

javascript
import { rotatePlugin } from "@sse-ui/pdf-rotate";

2. Create the plugin

javascript
const rotatePluginInstance = rotatePlugin();

The plugin instance rotatePluginInstance provides the following properties:

PROPERTYTYPEDESCRIPTIONFROM
RotateReactElementCustomizable rotate button1.0.0
RotatePageReactElementRotate a single page1.0.0
RotateBackwardButtonReactElementThe default button to rotate counterclockwise1.0.0
RotateBackwardMenuItemReactElementCustomizable menu item to rotate counterclockwise1.0.0
RotateForwardButtonReactElementThe default button to rotate clockwise1.0.0
RotateForwardMenuItemReactElementCustomizable menu item to rotate clockwise1.0.0

3. Register the plugin

Register the rotate plugin instance:

javascript
<Viewer plugins={[rotatePluginInstance]} />

Properties

The rotate plugin provides other useful properties as following:

javascript
import {
  RotateBackwardIcon,
  RotateForwardIcon,
} from "@sse-ui/pdf-rotate";
PROPERTYTYPEDESCRIPTIONFROM
RotateBackwardIconReactElementThe rotate counterclockwise icon1.0.0
RotateForwardIconReactElementThe rotate clockwise icon1.0.0

Released under the MIT License.