Some test text!

menu

Get started with Flutter

Welcome to PDFTron. PDFTron SDK can be integrated with Flutter for both Android and iOS.

Get started with Flutter

See here for the get started guide for using the PDFTron Flutter SDK on iOS.

This guide will help you integrate a free trial of the PDFTron SDK into your Android applications using Flutter. Your free trial includes unlimited trial usage and support from solution engineers.

Get the Flutter source code

linkPrerequisites

  • PDFTron SDK >= 6.9.0
  • Flutter >= 1.0.0
No trial license key required.
The trial of PDFTron SDK works without a license key. A commercial license key is required for use in a production environment. Please fill out our licensing form if you do not have a valid license key.
Keep your commercial license key confidential.
License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).

linkIntegrate

For simplicity the following guide is based on a boilerplate flutter app of flutter create myapp with git diff syntax for adding and removing lines from the boilerplate app.

  1. First follow the Flutter get started guides to install, set up an editor, and create a Flutter Project. The rest of this guide assumes your project is created by running flutter create myapp.
  2. Add the following dependency to your Flutter project in myapp/pubspec.yaml:

    dependencies:
       flutter:
         sdk: flutter
    +  pdftron_flutter:
    +    git:
    +      url: git://github.com/PDFTron/pdftron-flutter.git
  3. Now add the following items in your myapp/android/app/build.gradle file:

    android {
    -   compileSdkVersion 27
    +   compileSdkVersion 28
    
        lintOptions {
            disable 'InvalidPackage'
        }
    
        defaultConfig {
            applicationId "com.example.myapp"
    -       minSdkVersion 16
    +       minSdkVersion 21
    -       targetSdkVersion 27
    +       targetSdkVersion 28
    +       multiDexEnabled true
            versionCode flutterVersionCode.toInteger()
            versionName flutterVersionName
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        ...
    }
  4. In your myapp/android/app/src/main/AndroidManifest.xml file, add the following lines to the <application> tag:

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="myapp"
        android:icon="@mipmap/ic_launcher"
    +   android:largeHeap="true"
    +   android:usesCleartextTraffic="true">

    Additionally, add the required permissions for your app in the <manifest> tag:

    <uses-permission android:name="android.permission.INTERNET" />
        <!-- Required to read and write documents from device storage -->
    +   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <!-- Required if you want to record audio annotations -->
    +   <uses-permission android:name="android.permission.RECORD_AUDIO" />
  5. Add your PDFTron license key to the myapp/android/gradle.properties file.

    PDFTRON_LICENSE_KEY=INSERT_COMMERCIAL_LICENSE_KEY_HERE_AFTER_PURCHASE

    Key can be left empty for a trial

linkNext step

View a document

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more
close