Some test text!

Integrate manually

In this document
chevron_rightDownload
chevron_rightIntegrate

linkDownload

A trial key is needed to use and download the SDK.

Get Your Free Trial License Key

linkIntegrate

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.

    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'
    }

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.