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.
Installation#
- Capacitor
- Cordova
- Enterprise
$ npm install pspdfkit-cordova $ npm install @ionic-native/pspdfkit-cordova $ ionic cap sync
$ ionic cordova plugin add pspdfkit-cordova $ npm install @ionic-native/pspdfkit-cordova
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#
ReactLearn more about using Ionic Native components in React
#
Angularimport { 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);