Skip to content

Document Scanner

The basic idea of the document scanner is to extract the sub-region of a photo or the live preview from the camera that contains the file. We provide a composable function called FioriDocScanner, which allows developers to retrieve the extracted files using its callback parameter.

How to Use FioriDocScanner

Here is a sample of how to use FioriDocScanner:

FioriDocScanner(
    scanner = MLKitDocScanner(), // Specify the internal processor for document scanning. By default, it is an `MLKitDocScanner` which is implemented upon the Google ML Kit solution.
    successListener = {
        urls->
        // When the scanner has finished processing the extraction,
        // the list of URLs of the extracted files, which are saved as images, will be called back here.
        // If the user simply cancels the scanning process, the `urls` will be an empty list.
    }
    failureListener = {
        errorMessage->
        // When an error is encountered during scanning, this callback will be triggered along with the `errorMessage`.
    }
)

For more information about the Document scanner with ML Kit on Android, please refer to the developer guide


Last update: December 13, 2024