Getting started

Running samplesTry demo in your projectDownloading PDFTronIntegrating PDFTron via GradleManually integrating PDFTronUpgradingAdding PDFTron license keyUsing ProGuardTroubleshooting integration


Document lockingSaving PDF documentsUnderstanding coordinates


Using an ActivityUsing a FragmentUsing PDFViewCtrlViewer configConverting and viewing other document typesConverting HTML to PDF


PDFViewCtrl color modesPDFViewCtrl page view modePDFViewCtrl page presentation modeGenerating thumbnails in PDF


Day/Night themesUndo and redoText searchAnnotation syncingRotating PDF pagesPDFViewCtrl read onlyUsing PDFViewCtrl with minimum memory


Tools overviewSetting Up ToolManagerChanging and disabling toolsIntercepting annotation handlingToolManager eventsDefault annotation propertiesTool subclasses


Deleting annotationsAnnotation styleShow/hide annotations

UI components

Quick menuAnnotation toolbarAnnotation style dialogThumbnail sliderAnnotations listOutline listUser bookmarks listBookmarks dialogPage thumbnails dialogAdd page dialogRotate pages dialogView mode dialogCrop page dialogReflow


Adding a custom view to a PDF pageCustom toolCustomizing quick menuCustomizing annotation style dialog


Running project in Android StudioSystem RequirementsPDFTron full vs. standardLocalizationIcon cheat sheetRunning sample with sourceReducing size of APKEnable multidexOut of memory when rotating device multiple timesDetachCurrentThread warning

PDF Processing API

What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
Running sampleskeyboard_arrow_down

Running sample projects

In this document
chevron_rightVia command line
chevron_rightVia Android Studio
chevron_rightCompleteReader app
A demo license key or a commercial license key is required to proceed. If you have not yet received a license key, please obtain a license key here before continuing to read this documentation.
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 examples that you could use in your project. Both samples are included in the download package under the \samples folder. You can run any of the sample projects via command line and/or via Android Studio.

linkVia command line

First, add your PDFTron license key into the file in the root folder of the sample project of interest (i.e. \samples\CompleteReader\ or \samples\MiscellaneousSamples\


Then, if you have not imported the project of interest into Android Studio, you will need to manually create a file in the root folder of the sample project of interest (i.e. \samples\CompleteReader\ or \samples\MiscellaneousSamples\, and add the following to it:

You can find this information in your Android Studio's SDK Manager window.
Before moving on, please ensure adb is in your $PATH environment variable.

To deploy via command line, simply navigate to the root folder of the sample project of interest (i.e. \samples\CompleteReader, or \samples\MiscellaneousSamples), have one device or emulator running, then run the following command:

For Windows:

.\gradlew.bat appStart

For Mac:

gradle appStart

For Mac users, if you encounter any errors, please make sure you have Homebrew and gradle installed, and that Gradle's version is above Gradle 4.1. Otherwise, do the following:

brew update && brew install gradle

linkVia Android Studio

First, add your PDFTron license key to the file in the root folder of the sample project of interest (i.e. \samples\CompleteReader\ or \samples\MiscellaneousSamples\


To deploy via Android Studio, follow the steps at Run existing project in Android Studio.

linkCompleteReader app

Download sample APK here: CompleteReader.apk.

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

SimpleReaderActivity is an all-in-one document reader and PDF editor. In addition to PDF files, it supports viewing other file extensions such as .docx, .doc, .pptx, .xlsx, .md, .cbz and various image formats. It allows stream conversion of these non-pdf documents to PDF format so you can view the document while conversion happens. In this activity, you can read, annotate, sign, and fill in PDF forms, and more. See the detailed list of features below.

AdvancedReaderActivity has everything in SimpleReaderActivity, plus file browsers for local and SD card files. It has an example of how you can implement lists of recent and favorite files. It also demonstrates how to use document thumbnails. In addition, it supports file merging and creating new files using styles such as lined, grid, graph, and music sheet. See the detailed list of features below.

To run the CompleteReader sample from source, check out this FAQ article.


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.