> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/ios/get-started/frameworks/flutter/flutter.md).

# Get started integrating Apryse Flutter SDK

Integrate a free trial of Apryse Flutter SDK into your projects with this comprehensive guide. Get unlimited usage and support from solution engineers. Explore iOS & Android PDF library integration no

Welcome to Apryse. This guide will help you integrate a free trial of the Apryse Flutter SDK into your Flutter Project. Your free trial includes unlimited trial usage and support from solution engineers.

{% tabs %}
{% tab title="iOS" %}

## iOS & Flutter PDF library integration

{% hint style="info" %}
Looking for Android? Check tabs above or switch to the [Flutter section on Apryse Android SDK](/android/get-started/frameworks/flutter/flutter-1.md)
{% endhint %}

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

<a href="https://github.com/ApryseSDK/pdftron-flutter/" class="button primary">Get the Flutter source code</a>

## Prerequisites

* Flutter >= 1.0.0

{% hint style="info" %}
**No trial license key required.**

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your license keys confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

## Integrate

For simplicity, the following guide is based on a boilerplate Flutter app and uses Git Diff syntax to represent lines that have been added to or removed from the app. Please follow these Flutter get started guides to [install](https://flutter.io/docs/get-started/install/), [set up an editor](https://flutter.io/docs/get-started/editor/), and [create a Flutter Project](https://flutter.io/docs/get-started/test-drive?tab=terminal#create-app) if you are a first time Flutter developer

1. Initialize the project by running the command:

{% code lineNumbers="true" %}

```sh
flutter create myapp
```

{% endcode %}

1. Add the following dependency to your Flutter project in `myapp/pubspec.yaml`:

* If you want to use our null safe package from pub.dev:

{% code lineNumbers="true" %}

```shell
dependencies:
        flutter:
        sdk: flutter
+ pdftron_flutter:
```

{% endcode %}

* If you want to use our null safe package from GitHub:

{% code lineNumbers="true" %}

```shell
dependencies:
        flutter:
        sdk: flutter
+ pdftron_flutter:
+ git:
+ url: git://github.com/ApryseSDK/pdftron-flutter.git
```

{% endcode %}

1. Navigate to your `myapp` folder:and run the following command to get the required packages:

{% code lineNumbers="true" %}

```sh
cd myapp
```

{% endcode %}

{% code lineNumbers="true" %}

```sh
flutter packages get
```

{% endcode %}

1. Open `myapp/ios/Podfile` and make these changes:

{% code lineNumbers="true" %}

```sh
# Uncomment this line to define a global platform for your project
- # platform :ios, '9.0'
+ platform :ios, "10.0"
   target 'Runner' do
     # ...
+ # Apryse Pods
+ pod 'PDFNet', podspec: 'https://www.pdftron.com/downloads/ios/cocoapods/xcframeworks/pdfnet/latest.podspec'
     # ...
    end
```

{% endcode %}

1. Run this command to ensure integration process is successful:

{% code lineNumbers="true" %}

```sh
flutter build ios --no-codesign
```

{% endcode %}

## Next step

<a href="/ios/get-started/frameworks/flutter/view-a-document.md" class="button primary">View a document</a>
{% endtab %}

{% tab title="Android" %}

## Android & Flutter PDF library integration

{% hint style="info" %}
Looking for iOS? Change to the [iOS tab ](/ios/get-started/frameworks/flutter/flutter.md)above.
{% endhint %}

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

<a href="https://github.com/ApryseSDK/pdftron-flutter/" class="button primary">Get the Flutter source code</a>

## Prerequisites

* Latest stable version of [Flutter](https://docs.flutter.dev/get-started/install/)
* Latest stable version of [Android Studio](https://developer.android.com/studio/)
* Have [Android NDK (Native Development Kit)](https://developer.android.com/studio/projects/install-ndk/) installed
* Have [npm](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/development_environment/) or [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) setup

{% hint style="info" %}
**No trial license key required.**

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your license keys confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

## Integrate

For simplicity, the following guide is based on a boilerplate Flutter app and uses Git Diff syntax to represent lines that have been added to or removed from the app. Please follow these Flutter get started guides to [install](https://flutter.io/docs/get-started/install/), [set up an editor](https://flutter.io/docs/get-started/editor/), and [create a Flutter Project](https://flutter.io/docs/get-started/test-drive?tab=terminal#create-app) if you are a first time Flutter developer

1. Initialize the project by running the command:

{% code lineNumbers="true" %}

```sh
flutter create myapp
```

{% endcode %}

1. Add the following dependency to your Flutter project in `myapp/pubspec.yaml`:

* If you want to use our null safe package from pub.dev://@data {"gitDiff":true}// dependencies: flutter: sdk: flutter

{% tabs %}
{% tab title="sh" %}
{% code lineNumbers="true" %}

````sh
```diff
````

{% endcode %}

{% endtab %} {% endtabs %}

{% code lineNumbers="true" %}

```
- pdftron\_flutter:
```

{% endcode %}

* If you want to use our null safe package from GitHub:

{% tabs %} {% tab title="Shell" %}

{% code lineNumbers="true" %}

```shell
dependencies:
   flutter:
      sdk: flutter
+ pdftron_flutter:
+ git:
+ url: git://github.com/ApryseSDK/pdftron-flutter.git
```

{% endcode %}

{% endtab %} {% endtabs %}

1. Navigate to your `myapp` folder:and run the following command to get the required packages:

{% tabs %} {% tab title="sh" %}

{% code lineNumbers="true" %}

```sh
cd myapp
```

{% endcode %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="sh" %}

{% code lineNumbers="true" %}

```sh
flutter packages get
```

{% endcode %}

{% endtab %} {% endtabs %}

1. Now add the following items in your `myapp/android/app/build.gradle` file:

{% tabs %} {% tab title="Groovy" %}

{% code lineNumbers="true" %}

```groovy
defaultConfig {
    applicationId "com.example.myapp"
- minSdkVersion flutter.minSdkVersion
+ minSdkVersion 21
+ multiDexEnabled true
+ manifestPlaceholders += [pdftronLicenseKey:PDFTRON_LICENSE_KEY]
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}
```

{% endcode %}

{% endtab %} {% endtabs %}

1. In your `myapp/android/app/src/main/AndroidManifest.xml` file, add the following lines:

{% tabs %} {% tab title="XML" %}

{% code lineNumbers="true" %}

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp">

   <!-- 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" />

   <!-- Enable usesCleartextTraffic in application attributes if you are working with HTTP files. If you are only working with HTTPS files, this is not required.-->
   <application ... + android:largeHeap="true" + android:usesCleartextTraffic="false">

     <!-- Add license key in meta-data tag here. This should be inside the application tag. -->
+ <meta-data
+ android:name="pdftron_license_key"
+ android:value="${pdftronLicenseKey}"/>

     <activity android:name=".MainActivity" android:exported="true" ... android:windowSoftInputMode="adjustResize">

         <!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. -->
         <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
         <intent-filter>
             <action android:name="android.intent.action.MAIN"/>
             <category android:name="android.intent.category.LAUNCHER"/>
         </intent-filter>
     </activity>
     <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
     <meta-data android:name="flutterEmbedding" android:value="2" />
 </application>
</manifest>
```

{% endcode %}

{% endtab %} {% endtabs %}

1. In your `android/gradle.properties` file, add the following line:

{% tabs %} {% tab title="Text" %}

{% code lineNumbers="true" %}

```
# Add the PDFTRON_LICENSE_KEY variable here.
# For trial purposes leave it blank.
# For production add a valid commercial license key.
PDFTRON_LICENSE_KEY=
```

{% endcode %}

{% endtab %} {% endtabs %}

1. If you are using the `DocumentView` widget, change the parent class of your `MainActivity` file (either Kotlin or Java) to `FlutterFragmentActivity`.

{% tabs %} {% tab title="Kotlin" %}

{% code lineNumbers="true" %}

```kotlin
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity : FlutterFragmentActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Next step

<a href="/android/get-started/frameworks/flutter/view-a-document.md" class="button primary">View a document</a>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/ios/get-started/frameworks/flutter/flutter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
