Cordova Integration with PSPDFKit for Web

Apache Cordova is an open source platform to build native apps using HTML5, CSS and JavaScript. The following also applies to Ionic.

PSPDFKit for Web Standalone Deployment

PSPDFKit for Web is not currently supported in Cordova projects.

The Standalone Deployment requires an HTTP server and Cordova does not use a localhost server to serve the contents of the www folder (HTML, JavaScript and CSS). Instead, Cordova uses the file:///path/to/resource/ scheme. The cordova-plugin-httpd third party plugin can be used to run a localhost HTTP server in our Cordova project and redirect to the Standalone Deployment example's index.html as soon as the local server is available.

We discovered performance issues, such running out of memory when executing JavaScript in the web views. This is especially noticeable on real Android devices. It was less of an issue in the emulators.

Our solution

We recommend that you use the currently recommended integration for Cordova projects which is based on the Native SDKs for iOS and Android.

If you absolutely wish to use PSPDFKit for Web, then you can run it on your own remote server and not in localhost. This way, your Cordova app act as a web browser without having to run any high-performance JavaScript in the web view.

Our Long-term Goal

We are constantly working on improving and optimizing PSPDFKit for Web and hopefully future versions of Android (8.0 or 9.0) will improve JavaScript performance in web views.