How to run my application with PDFNet tools open source code?

The sample referred to in this guide is introduced in the details here. Please make sure you have read the getting started guide before proceeding.

As an example, in this guide we will go through how to run CompleteReader sample project from source.

Before we begin, let's clean the project. In Android Studio, Build -> Clean Project, or gradle clean from command line.

First, open /samples/CompleteReader/build.gradle.

Replace:

implementation "com.pdftron:pdftron@aar"

implementation "com.pdftron:floatingactionbutton@aar"
implementation "com.pdftron:pagecropper@aar"

with:

implementation project(':pdftron')

implementation project(':FloatingActionButton')
implementation project(':PageCropper')

Open /samples/CompleteReader/settings.gradle. Add:

include ':pdftron'
project(':pdftron').projectDir = new File(rootProject.projectDir, '../../lib/src/pdftron')
include ':PDFViewCtrlTools'
project(':PDFViewCtrlTools').projectDir = new File(rootProject.projectDir, '../../lib/src/PDFViewCtrlTools')
include ':pdfnet-demo-utils'
project(':pdfnet-demo-utils').projectDir = new File(rootProject.projectDir, '../../lib/src/pdfnet-demo-utils')
include ':PageCropper'
project(':PageCropper').projectDir = new File(rootProject.projectDir, '../../lib/src/PageCropper')
include ':FloatingActionButton'
project(':FloatingActionButton').projectDir = new File(rootProject.projectDir, '../../lib/src/FloatingActionButton')

Then, open /samples/CompleteReader/app/build.gradle. Replace:

implementation "com.pdftron:tools@aar"
implementation "com.pdftron:demo@aar"

with:

implementation project(':PDFViewCtrlTools')
implementation project(':pdfnet-demo-utils')

Lastly, go back to the root folder, in /lib/src, create a new folder with name pdftron.

Then, create a new file with name build.gradle, and add content:

configurations.maybeCreate("default")
artifacts.add("default", file('pdftron.aar'))

Copy /lib/full/pdftron.aar into /lib/src/pdftron folder.

Sync and run the project if you are using Android Studio, or simply run gradle appStart from command line.

Now CompleteReader sample project is running from source!