---
title: Announcing the Capacitor Document Scanner Plugin
description: Our new Capacitor document scanner plugin wraps ML Kit and VisionKit for edge detection, perspective correction, and PDF output in two API calls.
date:
  created: 2026-09-04
  updated: 2026-09-04
authors:
  - robingenz
categories:
  - Announcements
  - Capacitor
  - SDKs
links:
  - Capacitor Document Scanner: sdks/capacitor/document-scanner.md
faq: true
---

# Announcing the Capacitor Document Scanner Plugin

Document scanning UI is a solved problem: Google and Apple each ship a polished, ML-powered scanner as part of the operating system, with edge detection, perspective correction, and a review step users already know from other apps. What a Capacitor app was missing is a bridge to them, so we built one. The [Capacitor Document Scanner plugin](../../sdks/capacitor/document-scanner.md) is our new Capacitor document scanner plugin, and its surface is deliberately tiny: check availability, scan, done. It's available today to all Capawesome [Insiders](../../insiders/index.md).

<!-- more -->

<div class="capawesome-z29o10a">
  <a href="https://capawesome.io/" target="_blank">
    <img alt="Build and deploy your Capacitor app with Capawesome Cloud" src="https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1" />
  </a>
</div>

**Key takeaways:**

- `@capawesome-team/capacitor-document-scanner` opens the platform's native scanner: Google's ML Kit document scanner on Android, VisionKit on iOS.
- Automatic edge detection, perspective correction, and multi-page capture come from the OS; the API is two methods, `isAvailable()` and `scanDocument(...)`.
- Scanned pages are returned as JPEG files in the cache directory; `generatePdf: true` additionally returns one combined PDF.
- On Android, the scanner is an on-demand Google Play services module, downloaded on first use, so it adds nothing to your app size.
- Built exclusively on public platform APIs, so it's safe for App Review and resilient to OS updates.
- Requires Capacitor 8 or later, Android and iOS only, part of the Capawesome Insiders subscription.

## What Is the Best Document Scanner Plugin for Capacitor?

Our answer: the one that doesn't ship its own camera stack. Most existing options bundle a custom capture pipeline with hand-tuned edge detection, which you then maintain, or they wrap only one platform and leave the other as an exercise. A bundled pipeline ages badly: camera APIs shift, detection models improve elsewhere, and every OS release is a small risk.

The platform scanners invert that maintenance story. Google's [ML Kit document scanner](https://developers.google.com/ml-kit/vision/doc-scanner){:target="_blank"} and Apple's VisionKit are the same scanning flows users meet in Google Drive and Apple Notes, they improve with every OS update, and they cost your app nothing to maintain. What the [Capacitor Document Scanner plugin](../../sdks/capacitor/document-scanner.md) adds is one typed API over both, consistent output on both platforms (JPEG paths, optional PDF), and options where the platforms actually expose them. Because it's built exclusively on public platform APIs, there's nothing App Review can object to and nothing that breaks when the OS moves on.

## Installation

To install the Capacitor Document Scanner plugin, please refer to the [Installation](../../sdks/capacitor/document-scanner.md/#installation) section in the plugin documentation. It's published to the Capawesome npm registry, so installation requires the license key that comes with a [Capawesome Insiders](../../insiders/index.md) subscription.

The setup is unusually short. On Android, Google's scanner activity requests the camera permission itself, so there are no manifest changes and no permission code to write. On iOS, a single `NSCameraUsageDescription` entry in `Info.plist` is all it takes; if it's missing, the plugin rejects with a clear error instead of crashing. One Android detail worth knowing: the scanner ships as an on-demand Google Play services module that is downloaded automatically the first time a scan starts, so your app binary stays exactly as big as it was.

## Usage

The whole lifecycle fits in a few lines. Check availability once, then scan — a receipt for expense tracking, a signed contract, an ID document, or a whiteboard after a meeting.

### Check the availability

[`isAvailable()`](../../sdks/capacitor/document-scanner.md#isavailable) tells you whether document scanning can work on this device: on Android it checks for Google Play services, on iOS for a camera and a supported iOS version.

```typescript
import { DocumentScanner } from '@capawesome-team/capacitor-document-scanner';

const isAvailable = async () => {
  const { available } = await DocumentScanner.isAvailable();
  return available;
};
```

Use it to hide or disable the scan button rather than letting a scan fail on the one device in your fleet without Play services.

### Scan a document

[`scanDocument(...)`](../../sdks/capacitor/document-scanner.md#scandocument) opens the native scanner. The user captures one or more pages, the OS detects the edges and corrects the perspective, and a review step offers cropping and rotation before the pages come back as JPEG files in the cache directory:

```typescript
import { DocumentScanner } from '@capawesome-team/capacitor-document-scanner';

const scanDocument = async () => {
  const { scannedImages } = await DocumentScanner.scanDocument({
    imageQuality: 80,
    pageLimit: 5,
  });
  return scannedImages;
};
```

`imageQuality` trades file size against fidelity (0 to 100, default 100), and `pageLimit` caps the number of pages (default 10). A user backing out of the scanner is a normal outcome, not an exception you forgot: the promise rejects with the `SCAN_CANCELED` error code, so handle it explicitly.

### Tune the Android scanner

Android exposes two extra options. `androidScannerMode` selects the editing capabilities of the scanner UI: `Base` (crop and rotate), `BaseWithFilter` (adds grayscale and auto-enhancement filters), or the default `Full`, which adds ML-based cleaning that removes stains, fingers, and shadows. `androidGalleryImportAllowed` lets users import an existing photo instead of capturing one, which covers the receipt that was photographed last week and lives in the camera roll. iOS has no counterparts, and that's the platform's call: VisionKit applies its image cleaning automatically and keeps its UI fixed.

### Get a PDF instead of loose images

For contracts, receipts, and anything a backend or an email attachment expects as a single file, set `generatePdf: true` and the result includes one combined PDF of all scanned pages:

```typescript
import { DocumentScanner } from '@capawesome-team/capacitor-document-scanner';

const scanDocumentAsPdf = async () => {
  const { pdf } = await DocumentScanner.scanDocument({
    generatePdf: true,
  });
  return pdf;
};
```

On Android the PDF is generated by ML Kit, on iOS it's composed from the page images. From there, the path plugs straight into our companion plugins: display it with the [Capacitor PDF Viewer plugin](../../sdks/capacitor/pdf-viewer.md), print it with the [Capacitor Printer plugin](../../sdks/capacitor/printer.md), or hand it to another app with the [Capacitor File Opener plugin](../../sdks/capacitor/file-opener.md). And when a scanned page needs further edits, such as brightness or contrast adjustments, the [Capacitor Photo Manipulator plugin](../../sdks/capacitor/photo-manipulator.md) works directly on the returned image files.

## Platform Differences Worth Knowing

The plugin keeps the platform semantics honest instead of papering over them:

- **`pageLimit`** is enforced by the scanner on Android. On iOS, VisionKit exposes no public API to stop the scanner after a set number of pages, so the plugin truncates the returned pages after scanning. Using a private API instead would put your app at risk during App Review, which is exactly the class of shortcut the plugin avoids.
- **Google Play services** is required on Android, since the scanner is a Play services module. `isAvailable()` reports this per device.
- **Storage is temporary.** Scanned images and PDFs land in the app's cache directory, and stale files from earlier scans are cleaned up automatically when the plugin loads. Copy anything you want to keep to a persistent location.

## FAQ

### What is the best document scanner plugin for Capacitor?

The [Capacitor Document Scanner plugin](../../sdks/capacitor/document-scanner.md) is the only one that wraps both platforms' native scanners (ML Kit on Android, VisionKit on iOS) behind a single typed API, with perspective-corrected JPEG output and an optional combined PDF. If you only need a single platform or want to build a custom capture UI, a narrower setup can be enough.

### Does the plugin work on the web?

No. Both methods are available on Android and iOS only and reject with an unimplemented error on the web.

### Why can't I limit the number of pages on iOS?

VisionKit has no public API to stop the scanner after a specific number of pages. The plugin truncates the result to `pageLimit` after scanning instead of resorting to private APIs.

### Where are the scanned files stored?

In the app's cache directory. The plugin cleans up its stale files automatically on load, so copy the images or the PDF to a persistent location if you need to keep them.

### Is the Capacitor Document Scanner plugin free?

No. It's part of the Capawesome [Insiders](../../insiders/index.md) subscription, which also covers all other Insiders plugins and priority support.

### Does it work with Ionic, Angular, React, or Vue?

Yes. The plugin is framework-agnostic and works in any Capacitor app, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

## Availability

The Capacitor Document Scanner plugin is available today to all Capawesome [Insiders](../../insiders/index.md) and requires Capacitor 8 or later. It supports Android and iOS; there is no web implementation. The same subscription covers every other Insiders plugin, so there's no separate license to buy.

New plugins and notable releases are announced in the Capawesome newsletter first.

[Subscribe to the Capawesome Newsletter](https://capawesome.io/newsletter/){ .md-button .md-button--primary }

## Conclusion

Shipping a document scanner used to mean owning a camera pipeline, an edge-detection model, and every bug in between. With the platform scanners it means two API calls into UIs your users already know, and the [Capacitor Document Scanner plugin](../../sdks/capacitor/document-scanner.md) is that bridge for Capacitor apps. The [API reference](../../sdks/capacitor/document-scanner.md#api) covers every option, and our guide on [Capacitor file handling](./capacitor-file-handling-guide.md) helps with what comes after the scan: moving, persisting, and sharing the resulting files.

**Missing a feature?** [Create a feature request](https://github.com/capawesome-team/capacitor-plugins/issues/new/choose){:target="_blank"} in our GitHub repository.

If you have any questions, join us on the [Capawesome Discord server](https://discord.gg/VCXxSVjefW){:target="_blank"}. To stay updated on the latest news, subscribe to the [Capawesome newsletter](https://capawesome.io/newsletter/){:target="_blank"}.
