Scanning a generic document from an image with the Android Document Data Extractor Module
The Scanbot SDK Document Data Extractor is not only capable of live detection, but can also extract data from still images imported from the gallery or any other source.
The following example apps are available to see the Document Data Extractor in action and to gain a comprehensive understanding of how to integrate it into your project:
Adding the feature as a dependency
DocumentDataExtractor is included in Scanbot SDK package 3. Therefore, add the dependency io.scanbot:sdk-package-3 or higher in your build.gradle:
implementation("io.scanbot:sdk-package-3:$latestSdkVersion")
implementation("io.scanbot:sdk-documentdata-assets:$latestSdkVersion")
Do not use multiple scanners (e.g., MRZ Scanner and Credit Card Scanner) at the same time.
Each scanner instance requires a lot of memory, GPU, and processor resources. Using multiple scanners will lead to performance issues for the entire application.
Initializing the SDK
Before use, the Scanbot SDK needs to be initialized. The following code snippet should be added to your Application class:
loading...
Processing the image
Retrieving images from the gallery
To select an image from the photo library and run detection on it, a class for an image import contract is created using the modern Android result API.
loading...
To run the gallery call and get a Bitmap using ImportImageContract, the following code is used:
loading...
Creating a scanner
loading...
Each call to createDocumentDataExtractor() will create a new DocumentDataExtractor and initialize memory for it. If more than one import operation is expected, do not create new scanners for each operation.
Detection
The Scanbot SDK is used to detect the desired element on the imported image.
loading...
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
