Getting started

Minimum requirements

React PDF Viewer is powered by React hooks completely. So it requires React 16.8 or later.

If you are using TypeScript, then it requires TypeScript 3.8 or later.

The TypeScript definition files of @react-pdf-viewer packages use export type syntax which is only available from TypeScript 3.8.

Step 1: Installing pdfjs library

React PDF Viewer uses the APIs provided by the popular pdfjs library. Execute the following command from the root folder to install pdfjs:

npm install pdfjs-dist@2.6.347

The pdfjs-dist will be added to the dependencies section in package.json:

{
    "dependencies": {
        "pdfjs-dist": "^2.6.347",
        ...
    }
}

Step 2: Installing the core package

npm install @react-pdf-viewer/core@2.6.0