Search docs/
Getting StartedPlugins

PSPDFKit-Cordova

The official plugin to use PSPDFKit with Cordova and Ionic.

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

Stuck on a Cordova issue?

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.

Contact Us Today!

Installation

ionic cordova plugin add pspdfkit-cordovanpm install @ionic-native/pspdfkit-cordovanpm install pspdfkit-cordovanpm install @ionic-native/pspdfkit-cordovaionic cap sync
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us

Supported Platforms

  • Android
  • iOS

Usage

React

See here.

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);