PSPDFKit for Electron Example App
- A PSPDFKit for Electron license. If you don't already have one you can request a free trial here.
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/
Clone the repo:
git clone https://github.com/PSPDFKit/pspdfkit-electron-example.git cd pspdfkit-electron-example
Install the project dependencies with
Now that everything is installed we need to configure the app to use our PSPDFKit for Web license key.
./config/license-key and replace the string
YOUR_LICENSE_KEY_GOES_HERE with the license key that you'll find following that link.
Important: If you are using Windows, do not use PowerShell. Instead, use Microsoft’s Developer Command Prompt for Visual Studio.
Running the Example
We are ready to launch the app!
npm run start
The Electron application will automatically start.
To open the developer tools inside Electron, uncomment the following line in
// Open the DevTools. mainWindow.webContents.openDevTools();
What's in This Repository
This repository contains an example integration of PSPDFKit for Electron. The project structure is influenced by the default Electron example app and comes with the following files:
||The main entry point used to create the Electron windows. This file does not contain major changes, with the exception of a validation to make sure that PSPDFKit is properly installed. It is responsible for loading
||This file is where we import PSPDFKit and set it up properly. We use it to extend PSPDFKit for Web with custom behavior.|
Build Production Packages
We recommend using
electron-packager or a similar solution to build the production bundles.
npm install -g electron-packager
Build Individual Packages
The following code will only work on macOS. For other platforms, please consult the documentation of
npm run package-mac npm run package-win (requires Wine: `brew cask install xquartz`, `brew install wine`) npm run package-linux (requires `apt-get install libgconf-2-4` on target Linux)
This software is licensed under a modified BSD license.
Please ensure you have signed our CLA so that we can accept your contributions.