feat(pspdfkit-cordova): add PSPDFKit-Cordova plugin #3210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to Test in a Newly Created Ionic Project
1. Build the PSPDFKit Ionic Native Plugin From This Branch:
cd
intoIonic-Native
and runnpm run build
.dist/@ionic-native/pspdfkit-cordova
.2. Integrate Into a Newly Created Ionic Project:
ionic start IonicDemo blank --type=angular --id=com.pspdfkit.ionic.example
to create a new Ionic project.cd
intoIonicDemo
and runionic cordova plugin add pspdfkit-cordova
to install thepspdfkit-cordova
plugin.www
directory:www/pdf/document.pdf
.config.xml
and change the deployment target to iOS 11 or later:Use your CocoaPods Key:
open plugins/pspdfkit-cordova/plugin.xml
and replaceYOUR_COCOAPODS_KEY_GOES_HERE
with your own key. If you’re an existing customer, you can find the CocoaPods and license keys in your customer portal. Otherwise, if you don’t already have PSPDFKit, sign up for our 60-day trial and you will receive an email with the instructions to get started.Modify
src/app/app.module.ts
to use PSPDFKit as follows:src/app/app.component.ts
to use the PSPDFKit plugin to Present a PDF:ionic cordova platform add ios
to add the iOS platform.node_modules/@ionic-native/
. Assuming both repos are forked next to each other, you should run the this commandcp -r ../Ionic-Native/dist/@ionic-native/pspdfkit-cordova /node_modules/@ionic-native/
.ionic cordova prepare ios
to prepare iOS platform.Always Embed Swift Standard Libraries
:platforms/ios/MyApp.xcworkspace
in Xcode, then build and run, or runionic cordova emulate ios
in the Terminal.