Skip to main content

Getting started

Sample Project​

If you prefer sample projects over documentation, check out our Docutain SDK Cordova Sample on Github.

Docutain SDK Dependencies​

The Docutain SDK for Cordova is distributed through npm package.

cordova plugin add @docutain/cordova-plugin-docutain-sdk

Android Manifest​

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. If you want to use the Document Scanner, declare the following in your config.xml

<platform name="android">
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest">
<application android:largeHeap="true" />
</edit-config>
</platform>

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.


NSCameraUsageDescription

Prerequisites​

Android​

Set android-minSdkVersion = 21 or higher in the config.xml file.

Set android-compileSdkVersion = 34 or higher in the config.xml file.

Set GradlePluginKotlinEnabled = true the config.xml file.

<platform name="android">
<preference name="android-minSdkVersion" value="21" />
<preference name="android-compileSdkVersion" value="34" />
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinCodeStyle" value="official" />
</platform>

SDK calling signature​

The Docutain SDK for Cordova provides an Cordova callback signature API and an promisify signature API.

The callback methods are available in DocutainSDK.

DocutainSDK.initSDK("<YOUR-LICENSE-KEY>", successCallback, errorCallback)

The promisified methods are available in DocutainSDKPromisify.

try{
await DocutainSDKPromisify.initSDK("<YOUR-LICENSE-KEY>")
}
catch(err)
{
//init of Docutain SDK failed
...
}