# ML Kit Document Scanner in action

DevFeed: [ML Kit Document Scanner in action](<https://devfeed.tech/articles/ml-kit-document-scanner-in-action-25944.md>)

Original publisher: [Read original article](<https://medium.com/google-developer-experts/ml-kit-document-scanner-in-action-1c3a49ef5a33?source=rss-cbfc736ddcd3------2>)

Author: Julien Salvi

Published: 2024-04-15T09:53:27Z

Content type: tutorial

Language: en

Sources: [Stories by Julien Salvi on Medium](<https://devfeed.tech/sources/stories-by-julien-salvi-on-medium.md>)

Topics: [ML Kit](<https://devfeed.tech/topics/ml-kit.md>), [Android](<https://devfeed.tech/topics/android.md>), [API](<https://devfeed.tech/topics/api.md>), [pdf](<https://devfeed.tech/topics/pdf.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [ml-kit](<https://devfeed.tech/tags/ml-kit.md>), [ml-kit-android](<https://devfeed.tech/tags/ml-kit-android.md>), [pdf](<https://devfeed.tech/tags/pdf.md>), [scanner](<https://devfeed.tech/tags/scanner.md>)

## AI overview

This tutorial explores ML Kit Document Scanner for Android and demonstrates integrating it into a messaging feature. The library digitizes physical documents, supports automatic capture, detection, cropping, rotation, image editing, and optional gallery import, with the scan flow delivered through Play Services.

## Source excerpt

Recently, ML Kit released a new library to digitize physical documents directly from your Android application. ML Kit Document Scanner allows the users to easily scan documents with maximum controls and minimum code integration. During my time at Aircall, I took some time to explore and integrate the library to build an Android-exclusive feature for the messaging scope. Discovering the library ML Document Scanner is the newborn of the ML Kit family. It allows users to convert physical documents into digital formats. The library now brings this feature to any apps with many capabilities like applying filters, cleaning the image, removing shadows and many more. The entire scan flow is delivered by the Play Services so no camera permission is mandatory and the library size (~300KB download size increase) has a low impact in your app (the ML models are also managed by the Play Services). So let's dig into the what the library offers. The ML Kit Document Scanner offers key capabilities like a high-quality user interface that ensures consistency across Android applications. With automatic capture and document detection, the users can effortlessly scan documents, while accurate edge detection ensures optimal cropping results. Additionally, automatic rotation detection ensures that scanned documents are presented upright. For developers seeking customization options, the Document Scanner API offers flexibility. You can set a limit on the number of pages scanned and enable or disable the capability to import from the photo gallery. Moreover, there are 3 editing modes available: basic editing capabilities, editing with image filters or editing with ML-enabled image cleaning capabilities (erase stains, fingers...). You will find a complete overview of the library with the official documentation. ML Kit | Google for Developers Build with Document ScannerCrafting the feature It's now time to craft our new feature with ML Kit Document Scanner. Here, we want to give the ability to t