Some test text!

Setup

Contents

Prerequisites
Installation
Add the plugin
iOS
Android

linkPrerequisites

  • A valid PDFTron license key. If you do not have a license key, please contact sales for a commercial license key or click here to get an evaluation key.

  • A valid integration credential. If you do not have an integration credential, please click here to get an integration credential.

linkInstallation

linkAdd the plugin

  1. The rest of this guide assumes your project is created by running cordova create MyApp com.example.myapp MyApp

  2. Navigate to the root of your project, i.e. MyApp, and integrate the plugin with the terminal command:

    cordova plugin add https://github.com:PDFTron/pdftron-cordova.git
  3. Follow platform specific steps

linkiOS

  1. Download the PDFTron iOS SDK, available here.

  2. Open the .dmg, and copy the /Lib directory to an appropriate location for your project.

  3. Drag the dynamic PDFNet and Tools frameworks (Lib/Framework-dynamic/PDFNet.framework, Lib/Tools/Tools.framework) into the "Embedded Binaries" section of your project, as indicated below.

    The pink rectangle shows where to drag PDFNet.framework and Tools.framework
  4. In your target's build phases:

    a) add a new run script phase (by clicking on the '+')
    b) add the following script:

    bash "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/PDFNet.framework/strip-framework.sh"

    This will ensure invalid slices are striped from the framework before being submitted to the app store (a longstanding Xcode bug).

    Create a new run script phase, and add the text as shown.

linkAndroid

  1. Add your PDFTron license key and credentials to MyApp/platforms/android/gradle.properties file. If you do not have an integration credential, please click here to get an integration credential.

    AWS_ACCESS_KEY=YOUR_ACCESS_KEY_GOES_HERE
    AWS_SECRET_KEY=YOUR_SECRET_KEY_GOES_HERE
    PDFTRON_LICENSE_KEY=YOUR_PDFTRON_LICENSE_KEY
  2. Open MyApp/platforms/android/app/src/main/java/com/example/myapp/MainActivity.java, and change the base class to CordovaAppCompatActivity:

    -public class MainActivity extends CordovaActivity {
    +public class MainActivity extends CordovaAppCompatActivity {
    }
  3. Open MyApp/platforms/android/app/src/main/AndroidManifest.xml, and change theme of MainActivity to @style/CustomAppTheme:

    -<activity android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" >
    +<activity android:name="MainActivity" android:theme="@style/CustomAppTheme" >
  4. Due to the change of MainActivity base class, use the following to build and run the project instead:

    First, in MyApp directory:

    cordova build android

    Then, import MyApp/platforms/android folder into Android Studio, and run the project from Android Studio using the play button.

    Note: When first import the project, Android Studio will complain about minSdk, click on Move minSdkVersion to build files and sync project in the error window to resolve.

Get the answers you need: Support

Contents

Prerequisites
Installation
Add the plugin
iOS
Android