RPConfig
The RPConfig component is a required component that allows you to set up global settings for React PDF Kit such as domain token and worker source. It should be placed at the root level of your application, wrapping any React PDF components.
| Name | Type | Description |
|---|---|---|
| licenseKey | string | A domain token for the React PDF Viewer component. To use a license, please refer to Licensing |
| workerUrl | string | (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 Dependency Override |
| wasmUrl | string | (optional) The URL or relative path pointing to the WebAssembly file used to process PDF documents. For example, WebAssembly URL |
import { RPConfig, RPProvider, RPLayout, RPPages } from '@react-pdf-kit/viewer'
export default () => ( <RPConfig licenseKey="YOUR_DOMAIN_TOKEN" workerUrl={...} wasmUrl={...}> <RPProvider src={...}> <RPLayout toolbar> <RPPages /> </RPLayout> </RPProvider> </RPConfig>)