Skip to main content

PSPDFKit-Cordova

The official plugin to use PSPDFKit with Cordova and Ionic.

https://github.com/PSPDFKit/PSPDFKit-Cordova

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation#

$ npm install pspdfkit-cordova
$ npm install @ionic-native/pspdfkit-cordova
$ ionic cap sync

Supported Platforms#

  • Android
  • iOS

Usage#

React#

Learn more about using Ionic Native components in React

Angular#

import { PSPDFKit } from '@ionic-native/pspdfkit-cordova/ngx';
constructor(private pspdfkit: PSPDFKit) { }
...
// Set your license key here.
this.pspdfkit.setLicenseKey("YOUR KEY");
// Show a PDF in single page mode, with a black background.
this.pspdfkit.present('document.pdf', {pageMode: 'single', backgroundColor: "black"})
.then(result => {
console.log(result); // Success
})
.catch(error => {
console.log(error); // Failed
});
}
// Scroll to page at index 1.
this.pspdfkit.setPage(1, true);