Chromium Embedded Framework (CEF)

PSPDFKit for Windows Vista/7/8/8.1 via CEF

With CEF, PSPDFKit can be integrated into almost any desktop-style application on any OS, similar to our Electron support. The most common use case is integrating PSPDFKit into apps that are built with WIN32 or WPF instead of UWP.

Using CEF with CefSharp on Windows

Support for CefSharp on Windows is currently in beta. Please contact us for a sample app.

The 7zip file provided contains a modified version of the official CefSharp minimal example solution. It is a Git repository, and the last commit on master contains the complete changes necessary for using our SDK with CefSharp.

A scheme handler, which supplies the files requested by the CefSharp control, is registered for http. This is just a very basic custom scheme handler to demonstrate how to handle requests, and it is not production-ready code. To fully implement a custom scheme handler, please consult the CefSharp documentation.

Running the Sample

To get the sample to run, do the following:

Unzip the minimal example project and open the solution contained within it.

Make sure CefSharp.MinimalExample.Wpf is the active project.

In the Solution Explorer, open the file CefSharp.MinimalExample.Wpf\Properties\assets\license.

Replace the LICENSE_KEY_GOES_HERE text with your license key.

Right-click on CefSharp.MinimalExample.Wpf\Properties\ assets and then click on Open Folder in File Explorer.

Copy all the files (i.e. pspdfkit.js, pspdfkit.css, pspdfkit.wasm, etc.) from the PSPDFKit for Web distributable folder, \package\dist, into the assets folder.

Open CefSharp.MinimalExample.Wpf\CefSharpSchemeHandlerFactory.cs and change the string cef.example.com to match the bundle ID of your license. This is essential!

Right-click on the project CefSharp.MinimalExample.Wpf and click on Build.

Start the project and it should display default.pdf in the app.

Troubleshooting

If the PDF is not displayed, you can troubleshoot the app while it is running by opening a Chrome browser, navigating to http://localhost:8088/, and clicking on PSPDFKit for Web.

This will open a connection to the running app and you can switch to the Console tab of the developer tools and examine any error messages.