Skip to content

PSPDFKit/pspdfkit-web-example-vite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSPDFKit for Web Example – Vite.js

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

Prerequisites

Support, Issues and License Questions

PSPDFKit offers support for customers with an active SDK license via https://pspdfkit.com/support/request/

Are you evaluating our SDK? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://pspdfkit.com/sales/

Getting Started

Clone the repo:

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

Install the project dependencies:

npm install

Running the Example

We are ready to launch the app! 🎉

npm run dev

You can now open http://localhost:5173 in your browser and enjoy!

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

npm run build
npm run preview

You can now preview your build http://localhost:4173 in your browser.

Enjoy 🍕

React Component

The React component which implements the PSPDFKit for Web integration can be found at src/components/PdfViewerComponent.jsx.

In order to make the PSPDFKit SDK assets available they have to be copied from the node_modules/pspdfkit/dist folder to public/pspdfkit-lib folder. For that purpose this example uses a copy plugin which you can find at vite.config.js.

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.