Adding to Your Project
This guide will walk you through adding PSPDFKit for Web to your project for standalone deployment.
Accessing license information for evaluation
- After requesting an evaluation license, follow the PSPDFKit for Web Trial link in the received email. This will automatically fill in the license information in the following examples on this page.
Accessing license information for existing customers
- In your web browser log in to https://customers.pspdfkit.com and navigate to the "Your Licenses & Keys" page.
- Locate your PSPDFKit for Web license and click "Download PSPDFKit for Web" to show all the download options.
- Depending on how you want to install the package follow the instructions from either the Manual download or Install with npm section below.
If you wish to add PSPDFKit for Web manually download the framework here.
The download will start immediately and will save a zip archive like
PSPDFKit-Web-binary-2017.9.0.zip to your computer.
Once the download is complete extract the archive and copy the entire content of its
dist folder to your project's folder.
Install with npm
PSPDFKit for Web can also be installed as an npm package. The package is securely hosted in our servers as a tarball and its url is unique to each customer and license. For each license we generate a NPM_KEY which is what makes a download link work.
Always use latest release:
yarn add https://customers.pspdfkit.com/npm/YOUR_NPM_KEY_GOES_HERE/latest.tar.gz
npm install --save https://customers.pspdfkit.com/npm/YOUR_NPM_KEY_GOES_HERE/latest.tar.gz
Note that when installing the
latest version you always get the most recent release,
so expect an hash mismatch when a new version of PSPDFKit for Web is released.
latest is similar to having
"pspdfkit": "*" in your
Pinning to a specific version (e.g. 2017.5.0):
yarn add https://customers.pspdfkit.com/npm/YOUR_NPM_KEY_GOES_HERE/2017.5.0.tar.gz
npm install --save https://customers.pspdfkit.com/npm/YOUR_NPM_KEY_GOES_HERE/2017.5.0.tar.gz
This will add a
dependency to your application's
package.json with the name
In order for PSPDFKit for Web to work you will need to copy all the library files (artifacts) except for
node_modules/pspdfkit/dist to your project folder and serve them from the same folder of your application module that requires
For example, let's assume that
pspdfkit is required in the main application file
1 2 3 4
// src/index.js import PSPDFKit from 'pspdfkit'; PSPDFKit.load(...);
1 2 3 4
// src/index.js var PSPDFKit = require('pspdfkit'); PSPDFKit.load(...);
Then, the application is built into a
./dist folder. The PSPDFKit for Web artifacts must be copied to the same
1 2 3 4 5 6
cp ./node_modules/pspdfkit/dist/pspdfkit.css \ ./node_modules/pspdfkit/dist/pspdfkit.wasm \ ./node_modules/pspdfkit/dist/pspdfkit.wasm.js \ ./node_modules/pspdfkit/dist/pspdfkit.asm.js \ ./node_modules/pspdfkit/dist/pspdfkit.asm.js.mem \ ./dist
We highly recommend to use a tool or module bundler like
webpack to automate this process.
In fact you may want to check out our sample application build with