The All New PSPDFKit-Cordova Plugin

Today we are happy to announce PSPDFKit-Cordova, our new plugin for Cordova and Ionic, in which we merged, unified, and improved our old plugins for Android and iOS.

Apache Cordova is an open source platform for building native apps using HTML5, CSS, and JavaScript. It allows you to target multiple platforms, such as Android and iOS, with a single codebase.

The new PSPDFKit-Cordova plugin allows us to offer a better app development experience, a unified cross-platform JavaScript API, compatibility with our latest iOS and Android SDKs, and so much more.

The Unified JavaScript API

Having a single plugin for both Android and iOS makes it easier to maintain a consistent API on both platforms. When we merged our old plugins into PSPDFKit-Cordova, we made sure that the new API is implemented on both Android and iOS, in order to improve the experience of writing cross-platform code.

In the table below, you can see the unified present function:

Old Android API Old iOS API Unified API
PSPDFKit.showDocument(uri, options, success, fail); PSPDFKitPlugin.present(path, success, fail, options); PSPDFKit.present(path, options, success, failure);

For more details, take a look at our API reference.

Compatibility and Improvements

We’ve updated our new plugin to take full advantage of the latest improvements in Cordova, Ionic, and the host operating systems. Below, we list some notable changes and improvements:

Migration Made Easy

If you were previously using one of our Cordova plugins, we made the migration to the new one very easy. Please take a look at our migration guides for more information about how to migrate to our new plugin.

Conclusion

You can find the new Cordova plugin on GitHub, where you can also find the documentation, API reference, and everything else you need to get started.

Our plugin is open source, so you can customize and extend it to suit your project’s requirements. If you’re looking to extend native APIs or contribute, we recommend that you take a look at our How to Expose Native iOS APIs to Cordova post. We look forward to pull requests that extend and improve the plugin.

PSPDFKit Newsletter

Subscribe to our newsletter for more articles like this.