Skip to content

mdaronco/pspdfkit-web-example-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an example project for PSPDFKit for Web and how to embed it into a react app.

First, get a trial license on https://pspdfkit.com/try/.

Setup

Install the pspdfkit npm package.

npm install --save https://customers.pspdfkit.com/npm/TRIAL-npm-url-received-via-email

Bootstrap the project by installing all the other dependencies. In this example we use Create React App.

npm install

Now that everything is installed let's define the PSPDFKit for Web LICENSE KEY.

Open up the package.json file from this repo, find and replace all the occurrencies of YOUR_LICENSE_KEY_GOES_HERE with the license key that you received via e-mail.

Done, we are ready to launch the app! 🎉

To run the app in development mode run:

npm run start

To create a production build of the app and serve it:

npm run build
serve -s build

Enjoy 🍕

React component

The React component which implements the PSPDFKit for Web integration can be found at src/components/pspsdfkit/index.js.

To run this example via Create React App we also had to configure the baseUrl that PSPDFKit for Web uses to load its artifacts and base css. Please take a look at src/App.js.

In order to make the files above available we had to copy them from the node_modules/pspsdfkit/dist folder using a script which you can find at scripts/copy-pspdfkit-files.js.

About

Add PDF Support to Your Web App in No Time with PSPDFKit for Web

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.6%
  • HTML 16.6%
  • CSS 3.8%