PSPDFKit as an Electron PDF SDK
PSPDFKit for Electron uses the standalone deployment of PSPDFKit for Web under the hood and works with Electron applications on all platforms (Windows, macOS, and Linux). We use WebAssembly to deliver fast rendering performance with low memory overhead.
We designed PSPDFKit for Electron to run in your renderer process. This allows you to be in full control of your
BrowserWindow while only requiring a simple HTML element as the mount target for PSPDFKit.
Using PSPDFKit for Electron in the main process will not work.
PSPDFKit for Electron will automatically load all required artifacts for you. In order for this to be possible, we require (at least)
fetch access for the
const webFrame = require("electron").webFrame; webFrame.registerURLSchemeAsPrivileged("file");
var webFrame = require("electron").webFrame; webFrame.registerURLSchemeAsPrivileged("file");
If you want to further restrict the privileges for the
file URL scheme, please keep in mind that we only require the
supportFetchAPI option to be set to
true. Additionally, we recommend you set up a custom Content Security Policy, as noted in the Electron documentation.
PSPDFKit for Electron will parse the PDF file locally using our WebAssembly renderer. No PDF file will ever be sent via the network.