https://github.com/peterdee/pdf-view
A demonstration of how the react-pdf should work with CRA-generated application
https://github.com/peterdee/pdf-view
create-react-app express react react-pdf
Last synced: 11 months ago
JSON representation
A demonstration of how the react-pdf should work with CRA-generated application
- Host: GitHub
- URL: https://github.com/peterdee/pdf-view
- Owner: peterdee
- License: mit
- Created: 2021-03-13T20:16:24.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-03-13T20:40:16.000Z (almost 5 years ago)
- Last Synced: 2025-01-21T10:11:15.497Z (about 1 year ago)
- Topics: create-react-app, express, react, react-pdf
- Language: JavaScript
- Homepage: http://localhost:3000
- Size: 448 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Viewing PDF files with React
A demonstration of how the `react-pdf` should work with CRA-generated application.
Stack: React, React-PDF.
### Deploy
```shell script
git clone https://github.com/peterdee/pdf-view
cd ./pdf-view
nvm use 14
npm i -g yarn
yarn
```
### Modules locking
Module versions are locked.
This is necessary only for the `react-pdf` though, as the contents of `worker.js` in the `public` directory was copied from the `pdfjs-dist/build/pdf.worker.min.js` file.
### Launch
```shell script
yarn start
```
Application is available at http://localhost:3000
### Build
```shell script
yarn build
```
The `public` directory contains a `worker.js` file that should be copied to the `build` folder, otherwise `react-pdf` will not work properly when static files are created.
### Serve static
```shell script
yarn serve
```
Static files are served with `express` on http://localhost:5500
### LICENSE
[MIT](LICENSE)