Attachment plugin

The attachment plugin lists all attachments of a PDF document.

Install

npm install '@react-pdf-viewer/attachment';

Usage

  • Import the plugin and styles:
import { attachmentPlugin } from '@react-pdf-viewer/attachment';

// Import styles
import '@react-pdf-viewer/attachment/lib/styles/index.css';
  • Create the plugin instance:
const attachmentPluginInstance = attachmentPlugin();

The plugin instance attachmentPluginInstance provides the following property:

PropertyTypeDescriptionFrom
AttachmentsReactElementThe component lists available attachments2.0.0
  • Finally, register the attachment plugin instance, and use the <Attachments /> component to list all attachments.

Example