---
description: Unofficial Capacitor plugin for Google ML Kit Document Scanner SDK to scan documents. With support for Android and iOS.
title: Capacitor ML Kit Document Scanner Plugin - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/mlkit/document-scanner.png
---

<!doctype html> 

[Skip to content ](#capacitor-ml-kit-document-scanner-plugin) 

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Notes ](#notes)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Terms & Privacy ](#terms-privacy)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)
* [ Entity Extraction ](/docs/sdks/capacitor/mlkit/entity-extraction/)
* [ Face Detection ](/docs/sdks/capacitor/mlkit/face-detection/)
* [ Face Mesh Detection ](/docs/sdks/capacitor/mlkit/face-mesh-detection/)
* [ GenAI Image Description ](/docs/sdks/capacitor/mlkit/genai-image-description/)
* [ GenAI Prompt ](/docs/sdks/capacitor/mlkit/genai-prompt/)
* [ GenAI Proofreading ](/docs/sdks/capacitor/mlkit/genai-proofreading/)
* [ GenAI Rewriting ](/docs/sdks/capacitor/mlkit/genai-rewriting/)
* [ GenAI Speech Recognition ](/docs/sdks/capacitor/mlkit/genai-speech-recognition/)
* [ GenAI Summarization ](/docs/sdks/capacitor/mlkit/genai-summarization/)
* [ Image Labeling ](/docs/sdks/capacitor/mlkit/image-labeling/)
* [ Language Identification ](/docs/sdks/capacitor/mlkit/language-identification/)
* [ Object Detection ](/docs/sdks/capacitor/mlkit/object-detection/)
* [ Pose Detection ](/docs/sdks/capacitor/mlkit/pose-detection/)
* [ Selfie Segmentation ](/docs/sdks/capacitor/mlkit/selfie-segmentation/)
* [ Smart Reply ](/docs/sdks/capacitor/mlkit/smart-reply/)
* [ Subject Segmentation ](/docs/sdks/capacitor/mlkit/subject-segmentation/)
* [ Text Recognition ](/docs/sdks/capacitor/mlkit/text-recognition/)
* [ Translation ](/docs/sdks/capacitor/mlkit/translation/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Notes ](#notes)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Terms & Privacy ](#terms-privacy)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)

# Capacitor ML Kit Document Scanner Plugin[¶](#capacitor-ml-kit-document-scanner-plugin "Permanent link")

Unofficial Capacitor plugin for [ML Kit Document Scanner](https://developers.google.com/ml-kit/vision/doc-scanner).[1](#fn:1)

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Use Cases[¶](#use-cases "Permanent link")

The Document Scanner plugin is typically used whenever an app needs to digitize paper documents with the camera, for example:

* **Receipt and expense capture**: Let users scan receipts and invoices as JPEG images or PDF files for expense tracking.
* **Document archiving**: Digitize contracts, letters, and other paperwork into multi-page PDF documents.
* **Form submission**: Let users scan and submit signed forms or supporting documents in your app.
* **Clean document photos**: Use the ML-enabled image cleaning capabilities to remove stains and fingers from scanned pages.

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-mlkit/document-scanner` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capacitor-mlkit/document-scanner
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

If needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:

* `$mlkitDocumentScannerVersion` version of `com.google.android.gms:play-services-mlkit-document-scanner` (default: `16.0.0`)

This can be useful if you encounter dependency conflicts with other plugins in your project.

## Usage[¶](#usage "Permanent link")

The following examples show how to scan a document and how to check and install the Google Document Scanner module.

### Scan a document[¶](#scan-a-document "Permanent link")

Start the document scanning process, which opens the ML Kit Document Scanner UI. You can allow gallery imports, limit the number of pages, and choose the result formats and scanner mode. Only available on Android:

`[](#%5F%5Fcodelineno-3-1)import { DocumentScanner } from '@capacitor-mlkit/document-scanner';
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const scanDocument = async () => {
[](#%5F%5Fcodelineno-3-4)  const result = await DocumentScanner.scanDocument({
[](#%5F%5Fcodelineno-3-5)    galleryImportAllowed: true,
[](#%5F%5Fcodelineno-3-6)    pageLimit: 5,
[](#%5F%5Fcodelineno-3-7)    resultFormats: 'JPEG_PDF',
[](#%5F%5Fcodelineno-3-8)    scannerMode: 'FULL',
[](#%5F%5Fcodelineno-3-9)  });
[](#%5F%5Fcodelineno-3-10)
[](#%5F%5Fcodelineno-3-11)  console.log('Scanned images:', result.scannedImages);
[](#%5F%5Fcodelineno-3-12)  console.log('PDF info:', result.pdf);
[](#%5F%5Fcodelineno-3-13)};
`

### Check and install the Google Document Scanner module[¶](#check-and-install-the-google-document-scanner-module "Permanent link")

The document scanner models, scanning logic, and UI flow are dynamically downloaded by Google Play services. Check if the module is available and install it if needed. The installation only starts with this call; the `googleDocumentScannerModuleInstallProgress` event notifies you about the progress. Only available on Android:

`[](#%5F%5Fcodelineno-4-1)import { DocumentScanner } from '@capacitor-mlkit/document-scanner';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const isGoogleDocumentScannerModuleAvailable = async () => {
[](#%5F%5Fcodelineno-4-4)  const result = await DocumentScanner.isGoogleDocumentScannerModuleAvailable();
[](#%5F%5Fcodelineno-4-5)  console.log('Is Google Document Scanner module available:', result.available);
[](#%5F%5Fcodelineno-4-6)};
[](#%5F%5Fcodelineno-4-7)
[](#%5F%5Fcodelineno-4-8)const installGoogleDocumentScannerModule = async () => {
[](#%5F%5Fcodelineno-4-9)  await DocumentScanner.installGoogleDocumentScannerModule();
[](#%5F%5Fcodelineno-4-10)  console.log('Google Document Scanner module installation started.');
[](#%5F%5Fcodelineno-4-11)};
[](#%5F%5Fcodelineno-4-12)
[](#%5F%5Fcodelineno-4-13)DocumentScanner.addListener('googleDocumentScannerModuleInstallProgress', (event) => {
[](#%5F%5Fcodelineno-4-14)  console.log('Installation progress:', event.progress, '%');
[](#%5F%5Fcodelineno-4-15)  console.log('Current state:', event.state);
[](#%5F%5Fcodelineno-4-16)});
`

## API[¶](#api "Permanent link")

* [scanDocument(...)](#scandocument)
* [isGoogleDocumentScannerModuleAvailable()](#isgoogledocumentscannermoduleavailable)
* [installGoogleDocumentScannerModule()](#installgoogledocumentscannermodule)
* [addListener('googleDocumentScannerModuleInstallProgress', ...)](#addlistenergoogledocumentscannermoduleinstallprogress-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Enums](#enums)

### scanDocument(...)[¶](#scandocument "Permanent link")

`[](#%5F%5Fcodelineno-5-1)scanDocument(options: ScanOptions) => Promise<ScanResult>
`

Starts the document scanning process.

Only available on Android.

| Param       | Type                        |
| ----------- | --------------------------- |
| **options** | [ScanOptions](#scanoptions) |

**Returns:** `Promise<[ScanResult](#scanresult)>`

**Since:** 7.3.0

---

### isGoogleDocumentScannerModuleAvailable()[¶](#isgoogledocumentscannermoduleavailable "Permanent link")

`[](#%5F%5Fcodelineno-6-1)isGoogleDocumentScannerModuleAvailable() => Promise<IsGoogleDocumentScannerModuleAvailableResult>
`

Check if the Google Document Scanner module is available.

If the Google Document Scanner module is not available, you can install it by using `installGoogleDocumentScannerModule()`.

Only available on Android.

**Returns:** `Promise<[IsGoogleDocumentScannerModuleAvailableResult](#isgoogledocumentscannermoduleavailableresult)>`

**Since:** 7.3.0

---

### installGoogleDocumentScannerModule()[¶](#installgoogledocumentscannermodule "Permanent link")

`[](#%5F%5Fcodelineno-7-1)installGoogleDocumentScannerModule() => Promise<void>
`

Install the Google Document Scanner module.

**Attention**: This only starts the installation. The `googleDocumentScannerModuleInstallProgress` event listener will notify you when the installation is complete.

Only available on Android.

**Since:** 7.3.0

---

### addListener('googleDocumentScannerModuleInstallProgress', ...)[¶](#addlistenergoogledocumentscannermoduleinstallprogress "Permanent link")

`[](#%5F%5Fcodelineno-8-1)addListener(eventName: 'googleDocumentScannerModuleInstallProgress', listenerFunc: (event: GoogleDocumentScannerModuleInstallProgressEvent) => void) => Promise<PluginListenerHandle>
`

Called when the Google Document Scanner module is installed.

Only available on Android.

| Param            | Type                                                                                                                 |
| ---------------- | -------------------------------------------------------------------------------------------------------------------- |
| **eventName**    | 'googleDocumentScannerModuleInstallProgress'                                                                         |
| **listenerFunc** | (event: [GoogleDocumentScannerModuleInstallProgressEvent](#googledocumentscannermoduleinstallprogressevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 7.3.0

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-9-1)removeAllListeners() => Promise<void>
`

Remove all listeners for this plugin.

Only available on Android.

**Since:** 7.3.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### ScanResult[¶](#scanresult "Permanent link")

Result of a document scan operation.

| Prop              | Type                | Description                                                                                                           | Since |
| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- | ----- |
| **scannedImages** | string\[\]          | An array of URIs for the scanned image pages (JPEG). Present if 'JPEG' or 'JPEG\_PDF' was requested in resultFormats. | 7.3.0 |
| **pdf**           | [PdfInfo](#pdfinfo) | Information about the generated PDF. Present if 'PDF' or 'JPEG\_PDF' was requested in resultFormats.                  | 7.3.0 |

#### PdfInfo[¶](#pdfinfo "Permanent link")

| Prop          | Type   | Description                        | Since |
| ------------- | ------ | ---------------------------------- | ----- |
| **uri**       | string | The URI of the generated PDF file. | 7.3.0 |
| **pageCount** | number | The number of pages in the PDF.    | 7.3.0 |

#### ScanOptions[¶](#scanoptions "Permanent link")

| Prop                     | Type             | Description                                        | Default                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Since       |       |
| ------------------------ | ---------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ----- |
| **galleryImportAllowed** | boolean          | Whether to allow importing from the photo gallery. | false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | 7.3.0       |       |
| **pageLimit**            | number           | The maximum number of pages that can be scanned.   | 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | 7.3.0       |       |
| **resultFormats**        | 'JPEG' \| 'PDF'  | 'JPEG\_PDF'                                        | The desired result formats. Can be 'JPEG', 'PDF', or 'JPEG\_PDF'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | 'JPEG\_PDF' | 7.3.0 |
| **scannerMode**          | 'FULL' \| 'BASE' | 'BASE\_WITH\_FILTER'                               | The scanner mode. BASE: Basic editing capabilities (crop, rotate, reorder pages, etc.). BASE\_WITH\_FILTER: Adds image filters (grayscale, auto image enhancement, etc.) to the BASE mode. FULL: Adds ML-enabled image cleaning capabilities (erase stains, fingers, etc.) to the BASE\_WITH\_FILTER mode. This mode will also allow future major features to be automatically added along with Google Play services updates, while the other two modes will maintain their current feature sets and only receive minor refinements. | "FULL"      | 7.3.0 |

#### IsGoogleDocumentScannerModuleAvailableResult[¶](#isgoogledocumentscannermoduleavailableresult "Permanent link")

| Prop          | Type    | Description                                                     | Since |
| ------------- | ------- | --------------------------------------------------------------- | ----- |
| **available** | boolean | Whether or not the Google Document Scanner module is available. | 7.3.0 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

#### GoogleDocumentScannerModuleInstallProgressEvent[¶](#googledocumentscannermoduleinstallprogressevent "Permanent link")

| Prop         | Type                                                                                | Description                                                    | Since |
| ------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| **state**    | [GoogleDocumentScannerModuleInstallState](#googledocumentscannermoduleinstallstate) | The current state of the installation.                         | 7.3.0 |
| **progress** | number                                                                              | The progress of the installation in percent between 0 and 100. | 7.3.0 |

### Enums[¶](#enums "Permanent link")

#### GoogleDocumentScannerModuleInstallState[¶](#googledocumentscannermoduleinstallstate "Permanent link")

| Members              | Value | Since |
| -------------------- | ----- | ----- |
| **UNKNOWN**          | 0     | 7.3.0 |
| **PENDING**          | 1     | 7.3.0 |
| **DOWNLOADING**      | 2     | 7.3.0 |
| **CANCELED**         | 3     | 7.3.0 |
| **COMPLETED**        | 4     | 7.3.0 |
| **FAILED**           | 5     | 7.3.0 |
| **INSTALLING**       | 6     | 7.3.0 |
| **DOWNLOAD\_PAUSED** | 7     | 7.3.0 |

## Notes[¶](#notes "Permanent link")

* The ML Kit Document Scanner models, scanning logic, and UI flow are dynamically downloaded by Google Play services. Users might have to wait for these to download before the first use. You can use the isGoogleDocumentScannerModuleAvailable and installGoogleDocumentScannerModule methods to check for and install the module, and listen to the googleDocumentScannerModuleInstallProgress event for progress updates.
* This API requires Android API level 21 or above.
* It also requires a minimal device total RAM of 1.7GB. If lower, it returns an `MlKitException` with error code `UNSUPPORTED` when calling the API (this plugin will reject the promise).
* Consider that generating document files takes time and requires processing power, so only request the output formats (JPEG, or PDF, or both) you actually need via the `resultFormats` option.

## FAQ[¶](#faq "Permanent link")

### Which platforms are supported by this plugin?[¶](#which-platforms-are-supported-by-this-plugin "Permanent link")

The plugin is only available on Android, since the underlying ML Kit Document Scanner is provided by Google Play services. All methods reject on other platforms.

### Why is the document scanner not available on first use?[¶](#why-is-the-document-scanner-not-available-on-first-use "Permanent link")

The ML Kit Document Scanner models, scanning logic, and UI flow are dynamically downloaded by Google Play services, so users might have to wait for the download before the first use. Use `isGoogleDocumentScannerModuleAvailable()` to check for the module, `installGoogleDocumentScannerModule()` to install it, and listen to the `googleDocumentScannerModuleInstallProgress` event for progress updates.

### Which result formats can I get from a scan?[¶](#which-result-formats-can-i-get-from-a-scan "Permanent link")

You can request JPEG images, a PDF file, or both via the `resultFormats` option. The result then contains an array of URIs for the scanned image pages and/or information about the generated PDF, including its URI and page count. Since generating document files takes time and processing power, only request the formats you actually need.

### What is the difference between the scanner modes?[¶](#what-is-the-difference-between-the-scanner-modes "Permanent link")

The `BASE` mode provides basic editing capabilities such as crop, rotate, and reorder pages. The `BASE_WITH_FILTER` mode adds image filters such as grayscale and auto image enhancement. The `FULL` mode (the default) additionally provides ML-enabled image cleaning capabilities, for example erasing stains and fingers, and will automatically receive future major features along with Google Play services updates.

### Are there any device requirements?[¶](#are-there-any-device-requirements "Permanent link")

Yes, the API requires Android API level 21 or above and a minimal device total RAM of 1.7 GB. On devices with less RAM, the API returns an `MlKitException` with error code `UNSUPPORTED` and the plugin rejects the promise.

### Can users import existing photos instead of scanning?[¶](#can-users-import-existing-photos-instead-of-scanning "Permanent link")

Yes, set the `galleryImportAllowed` option to `true` to allow importing pages from the photo gallery. It is disabled by default.

## Related Plugins[¶](#related-plugins "Permanent link")

* [ML Kit Barcode Scanning](https://capawesome.io/docs/sdks/capacitor/mlkit/barcode-scanning/): Scan barcodes and QR codes with ML Kit Barcode Scanning.
* [PDF Viewer](https://capawesome.io/docs/sdks/capacitor/pdf-viewer/): Display PDF documents in a fullscreen native viewer.
* [File Opener](https://capawesome.io/docs/sdks/capacitor/file-opener/): Open a scanned file with the default application.

## Terms & Privacy[¶](#terms-privacy "Permanent link")

This plugin uses the [Google ML Kit](https://developers.google.com/ml-kit):

* [Terms & Privacy](https://developers.google.com/ml-kit/terms)
* [Android Data Disclosure](https://developers.google.com/ml-kit/android-data-disclosure)
* [iOS Data Disclosure](https://developers.google.com/ml-kit/ios-data-disclosure)

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/document-scanner/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/document-scanner/LICENSE).

---

1. This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries. [↩](#fnref:1 "Jump back to footnote 1 in the text")

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/#article", "headline": "Capacitor ML Kit Document Scanner Plugin", "name": "Capacitor ML Kit Document Scanner Plugin", "description": "Unofficial Capacitor plugin for Google ML Kit Document Scanner SDK to scan documents. With support for Android and iOS.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/#software", "name": "Capacitor ML Kit Document Scanner Plugin", "description": "Unofficial Capacitor plugin for Google ML Kit Document Scanner SDK to scan documents. With support for Android and iOS.", "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Which platforms are supported by this plugin?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin is only available on Android, since the underlying ML Kit Document Scanner is provided by Google Play services. All methods reject on other platforms."}}, {"@type": "Question", "name": "Why is the document scanner not available on first use?", "acceptedAnswer": {"@type": "Answer", "text": "The ML Kit Document Scanner models, scanning logic, and UI flow are dynamically downloaded by Google Play services, so users might have to wait for the download before the first use. Use isGoogleDocumentScannerModuleAvailable() to check for the module, installGoogleDocumentScannerModule() to install it, and listen to the googleDocumentScannerModuleInstallProgress event for progress updates."}}, {"@type": "Question", "name": "Which result formats can I get from a scan?", "acceptedAnswer": {"@type": "Answer", "text": "You can request JPEG images, a PDF file, or both via the resultFormats option. The result then contains an array of URIs for the scanned image pages and/or information about the generated PDF, including its URI and page count. Since generating document files takes time and processing power, only request the formats you actually need."}}, {"@type": "Question", "name": "What is the difference between the scanner modes?", "acceptedAnswer": {"@type": "Answer", "text": "The BASE mode provides basic editing capabilities such as crop, rotate, and reorder pages. The BASE_WITH_FILTER mode adds image filters such as grayscale and auto image enhancement. The FULL mode (the default) additionally provides ML-enabled image cleaning capabilities, for example erasing stains and fingers, and will automatically receive future major features along with Google Play services updates."}}, {"@type": "Question", "name": "Are there any device requirements?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the API requires Android API level 21 or above and a minimal device total RAM of 1.7 GB. On devices with less RAM, the API returns an MlKitException with error code UNSUPPORTED and the plugin rejects the promise."}}, {"@type": "Question", "name": "Can users import existing photos instead of scanning?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, set the galleryImportAllowed option to true to allow importing pages from the photo gallery. It is disabled by default."}}], "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/document-scanner/"}
```
