cordova platform add ios (to add test platform)
cordova plugin add cordova-plugin-foxitpdf
cordova plugin add cordova-plugin-file
Unzip Foxit PDF SDK for iOS and copy libs folder into the component ios folder. (The latest version is 9.0.0 )
-
Target -> General ->Embedded Binaries, Add dynamic framework "FoxitRDK.framework" 、 "uiextensionsDynamic.framework" and "FoxitPDFScanUI.framework" to framework folder and also to Xcode’s Embedded Binaries
-
Target -> General -> Linked Frameworks and Libraries -> + -> WebKit.framework
-
Target -> Build Settings -> Validate Workspace -> YES (Xcode 12+)
cordova prepare
Congratulations! You can preview this pdf file now.
cordova platform add android
cordova plugin add cordova-plugin-foxitpdf
if you use Foxit PDF SDK version greater than or equal to 6.4, you can add this plugin:
cordova plugin add cordova-plugin-file
Step2: Migrate to AndroidX, Add the following configuration to xxx/platforms/android/gradle.propertie:
android.useAndroidX=true
android.enableJetifier=true
Step3: Unzip foxitpdfsdk_(version_no)_android.zip
and copy libs folder into the component android folder.
You can download foxitpdfsdk_(version_no)_android.zip from https://developers.foxitsoftware.com/pdf-sdk/android/ (The latest version is 8.4.0)
Let's take the file in the root directory of the mobile phone as an example.
Preview the file list on the phone:
Note: index.js contains the sample code of ios and android, but the code of anroid has been commented out, you need to release the relevant code of android, and comment out ios.
cd /demo/demoApp/platforms/android
cordova run android
Congratulations! You can preview this pdf file now.