Skip to content

RPConfig

The RPConfig component is a required component that allows you to set up global settings for the React PDF such as license key and worker source. It should be placed at the root level of your application, wrapping any React PDF components.

Props

NameTypeDescription
licenseKeystringA license key for React PDF.
To use a license, please refer to Licensing
workerUrlstring(optional) The URL or relative path pointing to the web worker file for handling PDF document which must correspond to the pdfjs-dist version being used. Normally, you will not need to configure the workerURL. To do so, please refer to Overriding Dependency

Usage

import { RPConfig, RPProvider, RPDefaultLayout, RPPages } from '@pdf-viewer/react'
export default () => (
<RPConfig licenseKey={YOUR_LICENSE_KEY} workerUrl={...}>
<RPProvider src={...}>
<RPDefaultLayout>
<RPPages />
</RPDefaultLayout>
</RPProvider>
</RPConfig>
)