npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@capgo/capacitor-document-scanner

v8.3.18

Published

Capacitor plugin to scan document iOS and Android

Readme

@capgo/capacitor-document-scanner

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/document-scanner/

Compatibility

| Plugin version | Capacitor compatibility | Maintained | | -------------- | ----------------------- | ---------- | | v8.*.* | v8.*.* | ✅ | | v7.*.* | v7.*.* | On demand | | v6.*.* | v6.*.* | ❌ | | v5.*.* | v5.*.* | ❌ |

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

npm install @capgo/capacitor-document-scanner
npx cap sync

Important Notes

Android Emulator Limitations

The ML Kit Document Scanner does not work on Android emulators. This is a limitation of Google Play Services and ML Kit on emulated devices. When testing your app:

  • ✅ Use a physical Android device for testing document scanning
  • ❌ Android emulators will show an error: "Document scanner is not supported on Android emulators"

This limitation is due to:

  • Google Play Services compatibility issues with emulator environments
  • ML Kit Document Scanner requiring actual hardware camera capabilities
  • Emulators lacking the necessary ML Kit runtime components

For development and testing, always use a real Android device.

Demo

Scanning one note

| iOS | Android | |:---:|:-------:| | iOS Demo | Android Demo |

API

scanDocument(...)

scanDocument(options?: ScanDocumentOptions | undefined) => Promise<ScanDocumentResponse>

Opens the device camera and starts the document scanning experience.

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | ScanDocumentOptions |

Returns: Promise<ScanDocumentResponse>


Interfaces

ScanDocumentResponse

| Prop | Type | Description | | ------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------ | | scannedImages | string[] | Scanned images in the requested response format. | | status | ScanDocumentResponseStatus | Indicates whether the scan completed or was cancelled. |

| Method | Signature | Description | | -------------------- | -------------------------------------------- | --------------------------------------- | | getPluginVersion | () => Promise<{ version: string; }> | Get the native Capacitor plugin version |

ScanDocumentOptions

| Prop | Type | Description | Default | | ------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- | | croppedImageQuality | number | Android only: quality of the cropped image from 0 - 100 (100 is best). | 100 | | letUserAdjustCrop | boolean | Android only: allow the user to adjust the detected crop before saving. Disabling this forces single-document capture. | true | | maxNumDocuments | number | Maximum number of documents to scan. On Android: limits documents the user can scan (1-24). On iOS: prevents scanning more than the specified number of pages (uses internal API swizzling). Set to 1 for single-scan mode where the scanner stops after one document. | 24 on Android, unlimited on iOS | | responseType | ResponseType | Format to return scanned images in (file paths or base64 strings). | ResponseType.ImageFilePath | | brightness | number | Brightness adjustment applied to scanned images. Range: -255 to 255 (0 = no change, positive = brighter, negative = darker) Useful for compensating low-light scans. | 0 | | contrast | number | Contrast adjustment applied to scanned images. Range: 0.0 to 10.0 (1.0 = no change, >1 = more contrast, <1 = less contrast) Helps improve text clarity in poorly lit scans. | 1.0 | | scannerMode | ScannerMode | Android only: scanner mode that controls ML Kit features and filters. - 'base': Basic scan with crop/rotate, no filters or ML cleaning - 'base_with_filter': Adds grayscale and auto-enhancement filters - 'full': All features including ML-based image cleaning (erases stains, fingers, etc.) | ScannerMode.Full |

Type Aliases

ResponseType

'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'

Enums

ScanDocumentResponseStatus

| Members | Value | Description | | ------------- | ---------------------- | --------------------------------- | | Success | 'success' | The scan completed successfully. | | Cancel | 'cancel' | The user cancelled the scan flow. |

ResponseType

| Members | Value | Description | | ------------------- | ---------------------------- | ------------------------------------------------ | | Base64 | 'base64' | Return scanned images as base64-encoded strings. | | ImageFilePath | 'imageFilePath' | Return scanned images as file paths on disk. |

ScannerMode

| Members | Value | Description | | -------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------- | | Base | 'base' | Basic document scanning with crop and rotate features only. No filters or ML-based enhancements. | | BaseWithFilter | 'base_with_filter' | Basic features plus automatic filters (grayscale, auto-enhancement). | | Full | 'full' | Full feature set including ML-based image cleaning. Automatically removes stains, fingers, and other artifacts. |

credits

This plugin is a re implementation of the original https://document-scanner.js.org Thanks for the original work, we recoded it with more modern SDK but explodes the same API