Skip to content

Zoom plugin

The zoom plugin provides a few components to zoom in or zoom out a PDF document. It also allows to customize these components.

Install

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

OR

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

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

Usage

1. Import the plugin

javascript
import { zoomPlugin } from "@sse-ui/pdf-zoom";

// Import styles
import "@sse-ui/pdf-zoom/lib/styles/index.css";

2. Create the plugin instance

javascript
const zoomPluginInstance = zoomPlugin(props?: ZoomPluginProps)

The zoomPlugin() function takes an optional ZoomPluginProps parameter that consists of the following property: (? denotes an optional property)

PROPERTYTYPEDESCRIPTIONFROM
enableShortcuts?booleanEnable shortcuts1.0.0

By default, users can use particular shortcuts to zoom in or zoom out the current document:

SHORTCUTACTION
ctrl + +Zoom in the document
ctrl + -Zoom out the document
ctrl + 0View the actual size of the document

The plugin instance zoomPluginInstance provides the following properties:

PROPERTYTYPEDESCRIPTIONFROM
CurrentScaleReactElementShow the current scale value1.0.0
ZoomReactElementCustomizable zoom button1.0.0
ZoomInReactElementCustomizable zoom in button1.0.0
ZoomInButtonReactElementThe default zoom in button1.0.0
ZoomInMenuItemReactElementThe default zoom in menu item1.0.0
ZoomOutReactElementCustomizable zoom out button1.0.0
ZoomOutButtonReactElementThe default zoom out button1.0.0
ZoomOutMenuItemReactElementThe default zoom out menu item1.0.0
ZoomPopoverReactElementThe default popover allows to zoom to specific level1.0.0
zoomToFunctionZoom to specific level1.0.0

Released under the MIT License.