Skip to content

Latest commit

 

History

History
123 lines (84 loc) · 4.5 KB

README.md

File metadata and controls

123 lines (84 loc) · 4.5 KB

How to use this demo

iOS

Open /demo/demoApp, Execute these commands

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 )

Open demoApp/platforms/ios/demoApp.xcworkspace

  1. Target -> General ->Embedded Binaries, Add dynamic framework "FoxitRDK.framework" 、 "uiextensionsDynamic.framework" and "FoxitPDFScanUI.framework" to framework folder and also to Xcode’s Embedded Binaries

  2. Target -> General -> Linked Frameworks and Libraries -> + -> WebKit.framework

  3. Target -> Build Settings -> Validate Workspace -> YES (Xcode 12+)

Put pdf file to document folder

Change filepath and sn/key in index.js

Execute command

cordova prepare

Xcode run , click cordova app ’s preview button .

Congratulations! You can preview this pdf file now.


Android

Step1: Open /demo/demoApp, Execute these commands

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)

Step4: Put the pdf file on your phone.

Let's take the file in the root directory of the mobile phone as an example.

Preview the file list on the phone:

Step5: Change filepath and sn/key in index.js.

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.

Step6: Run the app

Run by command

cd /demo/demoApp/platforms/android
cordova run android

Run by Android Studio

Congratulations! You can preview this pdf file now.