Getting Started

With PSPDFKit Instant, it’s easier than ever to add real-time collaboration features to your PSPDFKit-powered app, allowing your users to seamlessly share, edit, and annotate PDF documents across Android, iOS, and Web apps. This article will guide you through integrating Instant into your own apps.

Requirements

  • PSPDFKit for Android with Instant

PSPDFKit and Instant are two separate Android libraries available in the same download. Download the latest release from customers.pspdfkit.com, or, for evaluation purposes, fill out the trial form. Download the latest release.

Quick Start with the Example Project

Instant comes with an example Android project named instant-example, which connects to either of our example server apps.

  1. Run PSPDFKit Server locally using one of our example projects.
  2. Add a document to the server using the Upload PDF button.
  3. Select the document to view it with PSPDFKit for Web.
  4. Import the example/instant project into Android Studio and run it.
  5. Run adb reverse tcp:5000 tcp:5000 && adb reverse tcp:3000 tcp:3000 to forward emulator/device ports to host ports. (5000 is the port of PSPDFKit Server, while 3000 is the port of our Web example).
  6. Once the example app is running, you can use http://localhost:3000 as a host name to access your local example server.
  7. Tap the document in the app to download it and show it in the activity.
  8. Add annotations in the app or in the browser to see annotation syncing.

Integrating into Your App

PSPDFKit Instant for Android is part of the PSPDFKit for Android library. To add Instant to your project:

  1. Integrate PSPDFKit.

  2. Add the specific dependencies required for Instant to your build.gradle file:

    build.gradle
    1
    2
    3
    
    ...
    implementation 'com.pspdfkit:pspdfkit-instant:6.0.2'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    

Manual Library File Integration

  1. Integrate PSPDFKit following the manual library file integration.

  2. Add the specific dependencies required for Instant to your build.gradle file:

    build.gradle
    1
    2
    3
    
    ...
    implementation 'com.pspdfkit:pspdfkit-instant:6.0.2@aar'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    

ℹ️ Note: Gradle looks for either the pspdfkit-instant.aar file or the pspdfkit-instant<version>.aar file, so inclusion will not work if you rename the AAR file.

ProGuard

There is no need to specify additional ProGuard rules since PSPDFKit uses consumersProguardFiles to keep ProGuard from obfuscating the required symbols. If you want to check out the rules, you should take a look in proguard.txt, which is located inside the PSPDFKit .aar:

1
2
3
cd [YOUR_AAR_LOCATION]
unzip [YOUR_AAR_NAME].aar -d aar-contents
cat aar-contents/proguard.txt