# vlx-react-pdf

> A React component to view a PDF document

Latest version **1.0.1** (published 2020-12-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install vlx-react-pdf
pnpm add vlx-react-pdf
yarn add vlx-react-pdf
bun add vlx-react-pdf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-12-04 |
| First published | 2020-12-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 613.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vlx |
| Maintainers | lpianciola |
| Keywords | react, react.js, pdf, pdf.js, pdf viewer |

## Links

- npm: https://www.npmjs.com/package/vlx-react-pdf
- npm.io page: https://npm.io/package/vlx-react-pdf

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-12-04
- 1.0.0 — 2020-12-04

## README

# React PDF viewer

A React component to view a PDF document.
It's written in TypeScript, and powered by React hooks completely.

1. Install packages

```console
$ npm install pdfjs-dist@2.5.207
$ npm install vlx-react-pdf
```

2. Import CSS and components

```javascript
import Viewer, { Worker } from 'vlx-react-pdf';
import 'vlx-react-pdf/cjs/react-pdf-viewer.css';
```

3. Use the component

```javascript
<Worker workerUrl="https://unpkg.com/pdfjs-dist@2.5.207/build/pdf.worker.min.js">
    <div style={{ height: '750px' }}>
        <Viewer fileUrl="/path/to/document.pdf" />
    </div>
</Worker>
```

## Commands

1. Build:

```console
$ npm run build
```

Then it will produce two formats available in the `dist` folder:

```
└─── dist
    ├─── cjs    // CommonJS package
    └─── umd    // UMD package
```

2. Dev mode:

```console
$ npm run dev
```

The bundler will watch the entire `src` folder and build the `cjs` package when any source file is changed.

3. Lint:

```console
$ npm run lint
```

It will check if the entire source code compatible with

- [ESLint](https://eslint.org)
- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)
- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)

---
_Source: https://npm.io/package/vlx-react-pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
