Some test text!

Integrate manually

An evaluation or commercial license key is required to run PDFTron. If you are evaluating the SDK and do not have a key, please obtain one, and then visit this page via the link included in the trial email. If your company has licensed PDFTron then you already received your key in an email from team@pdftron.com. See sign in for more details.
Android Studio is required in order to include PDFTron in your app. The Eclipse IDE is not supported.

Supported SDK versions:

  • Minimum: API 16 (using Android Support Libraries)
  • Recommended target: API 28

Besides integrating with Gradle's Maven package manager, you can also integrate manually by copying the required aar files to your project. This is typically done in order to integrate custom builds or nightly builds containing the latest updates into your application. Here are a few simple steps to integrate PDFTron libraries into your own Android Studio project.

  1. Extract your PDFTronAndroid library zipped bundle.

  2. Copy either the file lib/full/pdftron.aar or the file lib/standard/pdftron.aar directly into your project's libs directory (usually app/libs) without the folder structure. You can read about the differences between the two versions here.

  3. Copy the files lib/floatingactionbutton.aar, lib/pagecropper.aar, and lib/tools.aar directly into your project's libs directory.

  4. (Optional) To use the activities shown in the CompleteReader sample project, copy the file lib/demo.aar directly into your project's libs directory.

    Now, your libs folder should look like this:

  5. Navigate back to the project's root folder. Add the following to your project's root-level build.gradle file's repositories section.

    buildscript {
        repositories {
            // ...
            mavenCentral()
        }
        dependencies {
            // ...
            classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
        }
    }
    
    allprojects {
        repositories {
            // ...
            flatDir {
                dirs 'libs'
            }
        }
    }
    Please make sure flatDir is added to the repositories tag of the allprojects block, NOT the buildscript block.
  6. In your module's build.gradle file (usually app/build.gradle), add suppport for multidex and add PDFTron to your project as a dependency:

    android {
        defaultConfig {
            // ...
            multiDexEnabled true
            vectorDrawables.useSupportLibrary = true
        }
    }
    
    dependencies {
        // ...
        implementation "com.pdftron:pdftron@aar"
        implementation "com.pdftron:tools@aar"
        implementation "com.pdftron:floatingactionbutton@aar"
        implementation "com.pdftron:pagecropper@aar"
    
        implementation "com.android.support:support-v4:28.0.0"
        implementation "com.android.support:appcompat-v7:28.0.0"
        implementation "com.android.support:recyclerview-v7:28.0.0"
        implementation "com.android.support:design:28.0.0"
        implementation "com.android.support.constraint:constraint-layout:1.1.2"
        implementation "android.arch.lifecycle:extensions:1.1.1"
    
        implementation "commons-io:commons-io:2.4"
        implementation "org.apache.commons:commons-lang3:3.5"        
        implementation "com.google.code.gson:gson:2.8.0"
        implementation "io.reactivex.rxjava2:rxjava:2.2.2"
        implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
    
        implementation 'com.android.support:multidex:1.0.3'
    }

    If you added demo.aar, then also add:

    dependencies {
        // ...
        implementation "com.pdftron:demo@aar"
        implementation 'com.facebook.fresco:fresco:1.2.0'
        implementation 'com.jakewharton:butterknife:8.8.1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    }

You are set to go! Now, it's time to add a PDFTron license key to your application and open a document in an activity.