Attachment plugin

The `attachment` plugin lists all attachments of a PDF document.

Install

npm install '@react-pdf-viewer/attachment';
The `attachment` plugin is included in the default-layout plugin

Usage

1. Import the plugin and styles
import { attachmentPlugin } from '@react-pdf-viewer/attachment';
// Import styles
import '@react-pdf-viewer/attachment/lib/styles/index.css';
2. Create the plugin instance
const attachmentPluginInstance = attachmentPlugin();
The plugin instance `attachmentPluginInstance` provides the following property:
PropertyTypeDescriptionFrom
`Attachments``ReactElement`The component lists available attachments2.0.0
3. Register the plugin
Register the `attachment` plugin instance, and use the `<Attachments />` component to list all attachments.
const { Attachments } = attachmentPluginInstance;
<Viewer plugins={[attachmentPluginInstance]} />;

See also

Changelog

v2.0.0
  • First release