Code Monkey home page Code Monkey logo

pspdfkit-web-example-react's Introduction

PSPDFKit for Web Example โ€“ React.js

This example shows how to integrate PSPDFKit for Web into a React app.

Prerequisites

Getting Started

Clone the repo.

git clone https://github.com/PSPDFKit/pspdfkit-web-example-react.git
cd pspdfkit-web-example-react

Install the pspdfkit npm package.

npm install --save https://customers.pspdfkit.com/npm/YOUR_NPM_KEY_GOES_HERE/latest.tar.gz

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

npm install

Now that everything is installed we need to configure the app to use our PSPDFKit for Web license key.

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

Running the Example

We are ready to launch the app! ๐ŸŽ‰

To run the app in development mode:

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/pspdfkit/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/pspdfkit/dist folder using a script which you can find at scripts/copy-pspdfkit-files.

License

This software is licensed under a modified BSD license.

Contributing

Please ensure you have signed our CLA so that we can accept your contributions.

pspdfkit-web-example-react's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.