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
Android Manifest
Camera Permission
If you want to use the Document Scanner, declare the following permission in your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
Runtime permission for camera is handled automatically by the Docutain SDK.
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 Manifest
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.
Prerequisites
Android
Set compileSdkVersion = 34
or higher in the variables.gradle
file.
Set android.enableJetifier=true
in the gradle.properties
file.
Set Kotlin version to 1.8.10
or higher in the top level build.gradle
file.
buildscript {
ext {
kotlin_version = '1.8.10'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}