Getting started
Sample Project
If you prefer sample projects over documentation, check out our Docutain SDK Capacitor Sample on Github.
Docutain SDK Dependencies
The Docutain SDK for Capacitor is distributed through npm package.
- npm
- yarn
npm install @docutain/capacitor-plugin-docutain-sdk
yarn add @docutain/capacitor-plugin-docutain-sdk
The Docutain SDK requires Capacitor 7 or higher. TypeScript type definitions are included.
After installing the package, sync the native projects:
npx cap sync
Android
CompileSdk and MinSdk
The compileSdkVersion of your app needs to be set to 36 or greater and the minSdkVersion to 23 or greater. Make sure your app meets these requirements in the android/variables.gradle file:
ext {
minSdkVersion = 23
compileSdkVersion = 36
}
Note that updating the compileSdkVersion (which allows newer APIs to be used) can be done seperately from updating targetSdkVersion. So this should have no negative impact on your app.
Kotlin and Android Gradle Plugin
Your app needs to use Kotlin 2.0 or higher. We recommend Kotlin 2.1.20. Add the Kotlin Gradle plugin to the top level android/build.gradle file.
To run the Docutain SDK on Android, your project also needs to have AGP (Android Gradle Plugin) Version 8.9.1 or higher. This is the first AGP version that supports compileSdk 36. Capacitor 7 projects use an older AGP version by default, so you need to raise it in the same file:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.9.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20"
// ...
}
}
We recommend to upgrade AGP with Android Studio. Open the native Android project of your Capacitor project with Android Studio and use the AGP Upgrade Assistant.
Memory settings
Your application will work with high-resolution images. To avoid OutOfMemoryError exceptions it is highly recommended to set android:largeHeap="true" in the <application> element of your AndroidManifest.xml file.
<application android:largeHeap="true" ...>
...
</application>
iOS
Deployment Target
The Docutain SDK requires iOS 15.0 or higher. Set the minimum iOS version in your ios/App/Podfile, otherwise CocoaPods will not be able to resolve the SDK. Capacitor 7 projects use 14.0 by default, so you need to raise it:
platform :ios, '15.0'
Also make sure the deployment target of your app target in Xcode is at least iOS 15.0.
Camera Permission
If you want to use the document scanner, you need to specify the reason for requesting access to the camera as part of the NSCameraUsageDescription in the Info.plist. If you don't the app will crash.
