Some test text!

Run sampleskeyboard_arrow_down

Run samples

In this document
chevron_rightAdding the PDFTron license key
chevron_rightRun with Android Studio
chevron_rightCompleteReader app
chevron_rightFeatures:
chevron_rightMiscellaneousSamples app
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.
If you are interested in trying out the sample activities in your application directly, please check out this article instead.

PDFTron for Android ships with two sample projects, each containing sample code you can use in your project. Both samples are included in the PDFTronAndroid zip package under the samples folder. You can run any of the sample projects via Android Studio or via command line.

If you prefer to load the sample app directly, you can download the APK here:

CompleteReader.apk

linkAdding the PDFTron license key

Before running the sample, add your PDFTron license key to the gradle.properties file in the root folder of the sample project of interest (i.e. samples\CompleteReader\gradle.properties or samples\MiscellaneousSamples\gradle.properties):

PDFTRON_LICENSE_KEY=YOUR_PDFTRON_LICENSE_KEY_GOES_HERE

linkRun with Android Studio

First, be sure you have the latest version of Android Studio. You can download the latest version here. If you already have Android Studio, check for the latest stable version by clicking Help > Check for Updates (on Mac Android Studio > Check for Updates).

  1. In the Welcome to Android Studio window, click Import project (Gradle, Eclipse ADT, etc.).
  1. Select the project folder containing the settings.gradle file and click OK.
  1. Run the project.

linkCompleteReader app

This app contains two document viewing and editing activities, SimpleReaderActivity and AdvancedReaderActivity.

SimpleReaderActivity is an all-in-one document reader and PDF editor. It also supports viewing and stream convertion of other file extensions such as .docx, .doc, .pptx, .xlsx, .md, .cbz, and various image formats. In this activity, you can read, annotate, sign, fill-in PDF forms, and more. See the list of features below for more detail.

AdvancedReaderActivity includes everything in SimpleReaderActivity plus file browser functionality for local and SD card files. It includes code samples for implementing lists for recent and favorite files, using document thumbnails, merging multiple documents, and creating new documents. See the list of features below for more detail.

linkFeatures:

linkMiscellaneousSamples app

This app showcases the functionality of the PDFTron SDK and includes the samples found on the sample code page. You can inspect its source code to learn how to use some of the main classes and features of the SDK, or just run the sample and view the results.