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 @awesome-cordova-plugins/pspdfkit-cordova
$ ionic cap sync
$ ionic cordova plugin add pspdfkit-cordova
$ npm install @awesome-cordova-plugins/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
React
Learn more about using Ionic Native components in React
Angular
import { PSPDFKit } from '@awesome-cordova-plugins/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);