docutain_sdk 1.3.5
docutain_sdk: ^1.3.5 copied to clipboard
Flutter plugin of the Docutain Document Scanner SDK for Android & iOS. High quality document scanning, data extraction, text recognition and PDF creation. Easily scan documents.
Docutain SDK for Flutter #
Preview #

What is it? #
The Docutain SDK brings functionalities for automatic document scanning, data capture, image processing, OCR text recognition, intelligent data extraction and PDF creation to your apps.
It works 100% offline, which ensures maximum data safety.
It contains individually licensable modules:
For more details visit our website https://sdk.Docutain.com
If you like to test the functionality without writing any lines of code, check out our Showcase Apps.
Usage #
The following shows a minimum example to use the document scanner. For all available features and theming possibilities, please check out our documentation.
Initialize #
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
}
For testing purposes, you can leave the license key empty. However, the SDK will stop working after 1 minute. You can get a free extended trial license on our website.
Start the scanner to scan documents #
On iOS, make sure to add a camera usage description. If you don't, the app will crash.
NSCameraUsageDescription - "In order to scan documents, you need to grant permission to access the camera."
To start the document scanner, provide a DocumentScannerConfiguration
and alter it according to your needs. Then just call scanDocument
and wait for the result.
Check out the documentation for possible scan configurations.
var scanConfig = DocumentScannerConfiguration();
var result = await DocutainSdkUi.scanDocument(scanConfig);
Generate a PDF document #
Once the user finished the scan, you can generate a PDF document out of the scanned pages. The PDF document will include the recognized text, making it searchable and selectable. Check out the documentation for more details.
File? pdfFile = await DocutainSdkDocument.writePDF(path, "testPDF");
Image Export #
It is also possible to get the scanned pages as single image files. Check out the documentation for more details.
final pageCount = await DocutainSdkDocument.pageCount();
for (var i = 1; i <= pageCount; i++) {
var fileReturn = await DocutainSdkDocument.writeImage(
i, path, "Image$i.jpg");
}
Text Recognition #
With a single line of code, you can get the recognized text of the scanned document or single pages. Check out the documentation for more details.
final text = await DocutainSdkDocumentDataReader.getText();
Data Extraction #
It is also possible to run data extraction on the scans to extract certain values, like Address, Amount, IBAN, Date and more. Check out the documentation for more details.
final data = await DocutainSdkDocumentDataReader.analyze();
Documentation of the Docutain SDK #
The documentation includes everything you need to know to integrate the Docutain SDK into your Flutter application. If you prefer sample projects over documentation, check out our Docutain SDK Flutter sample app on Github to get a quick start on how to scan documents.
Changelog #
All changes included in each version can be found here: Changelog
License and Support #
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.
If you need technical support of any kind, please contact us via support.sdk@Docutain.com.
Blog #
Check out our blog articles on How to create a Flutter Document Scanner and How to create a Flutter Plugin from scratch.