Skip to content

Get File plugin

The get-file plugin provides a button that can be used to download the PDF document. It is able to customize the download button as well.

Install

> npm install @sse-ui/pdf-get-file

OR

> yarn add @sse-ui/pdf-get-file

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

Usage

1. Import the plugin

javascript
import { getFilePlugin } from "@sse-ui/pdf-get-file";

2. Create the plugin instance

javascript
const getFilePluginInstance = getFilePlugin(props?: GetFilePluginProps);

The getFilePlugin() function takes a GetFilePluginProps parameter that consists of the following property:

PROPERTYTYPEDESCRIPTIONFROM
fileNameGeneratorOpenFile => StringGenerate the name of download file1.0.0

The plugin instance getFilePluginInstance provides the following properties:

PROPERTYTYPEDESCRIPTIONFROM
DownloadReactElementCustomizable download button1.0.0
DownloadButtonReactElementThe default download button1.0.0
DownloadMenuItemReactElementThe default download menu item1.0.0

3. Register the plugin

Finally, register the get-file plugin instance:

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

Properties

The get-file plugin provides other useful property as following:

javascript
import { DownloadIcon } from "@sse-ui/pdf-open";
PROPERTYTYPEDESCRIPTIONFROM
DownloadIconReactElementThe download file icon1.0.0

Released under the MIT License.