The sample code below creates a button that clicking it will rotate the document counterclockwise:
import { RotateDirection } from '@react-pdf-viewer/core';
import { RenderRotateProps, rotatePlugin } from '@react-pdf-viewer/rotate';
const rotatePluginInstance = rotatePlugin();
const { Rotate } = rotatePluginInstance;
<Rotate direction={RotateDirection.Backward}>
{(props: RenderRotateProps) => (
<button
style={{
backgroundColor: '#357edd',
border: 'none',
borderRadius: '4px',
color: '#ffffff',
cursor: 'pointer',
padding: '8px',
}}
onClick={props.onClick}
>
Rotate backward
</button>
)}
</Rotate>;