SDK Initialization
License Key
The Docutain SDK for Flutter needs a valid, non-expired license key in order to work. For Android the license is bound to the applicationId
which you can find in the build.gradle
file of your Android project.
defaultConfig {
...
applicationId "de.docutain.sdk.sample"
...
}
For iOS the license is bound to the Bundle identifier
which you can find in the "General" or "Signing & Capabilities" settings tab of your project in Xcode.
Trial license
The Docutain SDK is a commercial product and requires a paid license for production use. In order to get a trial license, please visit our website via https://sdk.docutain.com/TrialLicense to generate a trial license key.
Production license
To get information about the SDK's functionality and pricing and to purchase a production license, please contact us.
Initialize
Base Initialization
In order to use any functionality of the SDK, you must initialize it first.
bool isDocutainPluginInitialized = await DocutainSdk.initSDK("Your_License_Key");
if(!isDocutainPluginInitialized){
//get the last error message
String error = await DocutainSdk.getLastError();
//implement handling to avoid accessing Docutain SDK when it is not initialized
}
If the initialization fails, you are responsible to deactivate access to SDK functionality.
Text detection (OCR) / data extraction initialization
If you want to use text detection (OCR) and/or data extraction features you need to provide an AnalyzeConfiguration
right after initializing the SDK.
bool isDocutainPluginInitialized = await DocutainSdk.initSDK("Your_License_Key");
if(!isDocutainPluginInitialized){
//get the last error message
String error = await DocutainSdk.getLastError();
//implement handling to avoid accessing Docutain SDK when it is not initialized
}
var analyzeConfig = AnalyzeConfiguration();
analyzeConfig.readBIC = true; //defaults to false
analyzeConfig.readPaymentState = true; //defaults to false
if(!await DocutainSdkDocumentDataReader.setAnalyzeConfiguration(analyzeConfig)){
//get the last error message
String error = await DocutainSdk.getLastError();
}
All configuration values of AnalyzeConfiguration
are optional.
Logging
The SDK writes certain information into a log file. You can get the log file by calling DocutainSdkLogger.getTraceFile()
. You can send this log file to us if you have any issues/bugs with the SDK. The Logger has certain levels that you can set depending on your needs. However, we suggest to leave the level to it's default value which ensures that in case of any issues/bugs we can get all the information we need from you.
//get the log file
var traceFile = await DocutainSdkLogger.getTraceFile();
//set the log level
DocutainSdkLogger.setLogLevel(Level.verbose);