Integrating PSPDFKit

This section explains the process of integrating PSPDFKit into your project. PSPDFKit is designed to work best with Android Studio and the Gradle build system. We recommend Android Studio 3.6.3 as the IDE and Android Gradle plugin 3.6.3 or higher for development.

Step 1: Adding PSPDFKit to Your Project

  1. In your top-level build.gradle file, add the PSPDFKit Maven repository:

    allprojects {
        repositories {
            maven {
                url ''
  2. In your app-level build.gradle file, add the PSPDFKit dependency:

    dependencies {
        implementation 'com.pspdfkit:pspdfkit:6.6.0'

Step 2: Configuring Your Build

PSPDFKit is supported on Android devices running API level 19 and newer, targeting the latest stable Android version 10 (API 29). Furthermore, PSPDFKit requires apps to enable Java 8 language features in order to build.

Inside your app-level build.gradle file, make sure to have the following configuration:

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.1'

    defaultConfig {
        applicationId ''
        minSdkVersion 19
        targetSdkVersion 29

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
With minSdkVersion set to 19 your app is available on more than 98.1 percent of devices on the Google Play Store (last update: June 2020).

Step 3: Getting the License Key

PSPDFKit is a commercial product and requires a license key during framework initialization. Make sure you have either a demo license or a full license before continuing.

  • Requesting a demo license key takes only a few minutes. To get one, visit and follow the steps there.

  • If you own a full license of PSPDFKit for Android, log in to the PSPDFKit Customer Portal and retrieve your license key from there.

Step 4: Initializing PSPDFKit

PSPDFKit for Android automatically initializes itself during your app’s startup. To make sure it can find your license key, copy the <meta-data> below this paragraph to your app’s AndroidManifest.xml. If you already have a license, it will be prefilled in the code example below.

        android:value="YOUR_LICENSE_KEY_GOES_HERE" />

💡 Tip: For additional information on how to initialize PSPDFKit, please refer to our Initializing PSPDFKit guide.

Step 5: Opening a PDF Document (Optional)

To verify that PSPDFKit was successfully integrated into your app, try opening a PDF file using the ready-to-use PdfActivity:

  1. Copy a PDF document into the assets directory of your Android project, for example to src/main/assets/my-document.pdf.

  2. Add PdfActivity to your app’s AndroidManifest.xml:

            android:windowSoftInputMode="adjustNothing" />
  3. You can now start PdfActivity with the document from your assets:

    val uri = Uri.parse("file:///android_asset/my-document.pdf")
    val config = PdfActivityConfiguration.Builder(context).build()
    PdfActivity.showDocument(this, uri, config)
    final Uri uri = Uri.parse("file:///android_asset/my-document.pdf");
    final PdfActivityConfiguration config = new PdfActivityConfiguration.Builder(context).build();
    PdfActivity.showDocument(this, uri, config);
  4. PdfActivity will now present the document from your assets.

Next Steps