{"id":32477033,"url":"https://github.com/cap-go/capacitor-document-scanner","last_synced_at":"2026-04-08T14:05:56.937Z","repository":{"id":318712709,"uuid":"1072619934","full_name":"Cap-go/capacitor-document-scanner","owner":"Cap-go","description":"Capacitor plugin to scan document iOS and Android","archived":false,"fork":false,"pushed_at":"2026-04-01T16:00:05.000Z","size":41420,"stargazers_count":18,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T02:30:54.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-10-09T01:33:13.000Z","updated_at":"2026-04-01T15:58:52.000Z","dependencies_parsed_at":"2026-01-28T17:07:12.545Z","dependency_job_id":"c7e2d096-5142-4305-80e8-de05323b3bb6","html_url":"https://github.com/Cap-go/capacitor-document-scanner","commit_stats":null,"previous_names":["cap-go/capacitor-document-scanner"],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-document-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-document-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-document-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-document-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-document-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-document-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-document-scanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-26T22:49:19.574Z","updated_at":"2026-04-08T14:05:56.931Z","avatar_url":"https://github.com/Cap-go.png","language":"Java","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":[],"sub_categories":[],"readme":"# @capgo/capacitor-document-scanner\n \u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_document_scanner\"\u003e ➡️ Get Instant updates for your App with Capgo\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_document_scanner\"\u003e Missing a feature? We’ll build the plugin for you 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\nCapacitor plugin to scan document iOS and Android\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/document-scanner/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **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.\n\n## Install\n\n```bash\nnpm install @capgo/capacitor-document-scanner\nnpx cap sync\n```\n\n## Important Notes\n\n### Android Emulator Limitations\n\nThe 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:\n\n- ✅ Use a **physical Android device** for testing document scanning\n- ❌ Android emulators will show an error: \"Document scanner is not supported on Android emulators\"\n\nThis limitation is due to:\n- Google Play Services compatibility issues with emulator environments\n- ML Kit Document Scanner requiring actual hardware camera capabilities\n- Emulators lacking the necessary ML Kit runtime components\n\n**For development and testing, always use a real Android device.**\n\n## Demo\n\n### Scanning one note\n\n| iOS | Android |\n|:---:|:-------:|\n| ![iOS Demo](videos/ios.gif) | ![Android Demo](videos/android.gif) |\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`scanDocument(...)`](#scandocument)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### scanDocument(...)\n\n```typescript\nscanDocument(options?: ScanDocumentOptions | undefined) =\u003e Promise\u003cScanDocumentResponse\u003e\n```\n\nOpens the device camera and starts the document scanning experience.\n\n| Param         | Type                                                                |\n| ------------- | ------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#scandocumentoptions\"\u003eScanDocumentOptions\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#scandocumentresponse\"\u003eScanDocumentResponse\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### Interfaces\n\n\n#### ScanDocumentResponse\n\n| Prop                | Type                                                                              | Description                                            |\n| ------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------ |\n| **`scannedImages`** | \u003ccode\u003estring[]\u003c/code\u003e                                                             | Scanned images in the requested response format.       |\n| **`status`**        | \u003ccode\u003e\u003ca href=\"#scandocumentresponsestatus\"\u003eScanDocumentResponseStatus\u003c/a\u003e\u003c/code\u003e | Indicates whether the scan completed or was cancelled. |\n\n| Method               | Signature                                    | Description                             |\n| -------------------- | -------------------------------------------- | --------------------------------------- |\n| **getPluginVersion** | () =\u0026gt; Promise\u0026lt;{ version: string; }\u0026gt; | Get the native Capacitor plugin version |\n\n\n#### ScanDocumentOptions\n\n| Prop                         | Type                                                  | Description                                                                                                                                                                                                                                                                                                                                                                        | Default                                 |\n| ---------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |\n| **`croppedImageQuality`**    | \u003ccode\u003enumber\u003c/code\u003e                                   | Android only: quality of the cropped image from 0 - 100 (100 is best).                                                                                                                                                                                                                                                                                                             | \u003ccode\u003e100\u003c/code\u003e                        |\n| **`letUserAdjustCrop`**      | \u003ccode\u003eboolean\u003c/code\u003e                                  | Allow the user to adjust the detected crop before saving. On iOS this forces the native VisionKit preview/editor after each capture using the private VisionKit navigation hooks needed to keep the scanner flow alive. On Android this enables ML Kit's crop adjustment flow.                                                                                                     | \u003ccode\u003etrue\u003c/code\u003e                       |\n| **`reviewCapturedDocument`** | \u003ccode\u003eboolean\u003c/code\u003e                                  | When enabled, shows the current scanned page before continuing so the user can review it and explicitly continue or finish the flow. On iOS this forces the native VisionKit preview/editor between captures. On Android this switches to a one-page-at-a-time flow between ML Kit sessions. The review/editor screen is still shown automatically when the scan limit is reached. | \u003ccode\u003efalse\u003c/code\u003e                      |\n| **`maxNumDocuments`**        | \u003ccode\u003enumber\u003c/code\u003e                                   | Maximum number of documents to scan. On iOS: VisionKit caps scans at 24 pages (system limit), and the hacked native flow can still stop earlier when you pass a smaller limit. On Android: customizable limit; defaults to 20 for performance (clamped 1-24). Set to 1 for single-scan mode where the scanner stops after one document.                                            | \u003ccode\u003e20 on Android, 24 on iOS\u003c/code\u003e   |\n| **`responseType`**           | \u003ccode\u003e\u003ca href=\"#responsetype\"\u003eResponseType\u003c/a\u003e\u003c/code\u003e | Format to return scanned images in (file paths or base64 strings).                                                                                                                                                                                                                                                                                                                 | \u003ccode\u003eResponseType.ImageFilePath\u003c/code\u003e |\n| **`brightness`**             | \u003ccode\u003enumber\u003c/code\u003e                                   | Brightness adjustment applied to scanned images. Range: -255 to 255 (0 = no change, positive = brighter, negative = darker) Useful for compensating low-light scans.                                                                                                                                                                                                               | \u003ccode\u003e0\u003c/code\u003e                          |\n| **`contrast`**               | \u003ccode\u003enumber\u003c/code\u003e                                   | Contrast adjustment applied to scanned images. Range: 0.0 to 10.0 (1.0 = no change, \u0026gt;1 = more contrast, \u0026lt;1 = less contrast) Helps improve text clarity in poorly lit scans.                                                                                                                                                                                                  | \u003ccode\u003e1.0\u003c/code\u003e                        |\n| **`scannerMode`**            | \u003ccode\u003e\u003ca href=\"#scannermode\"\u003eScannerMode\u003c/a\u003e\u003c/code\u003e   | 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.)                                                                                   | \u003ccode\u003eScannerMode.Full\u003c/code\u003e           |\n\n\n### Type Aliases\n\n\n#### ResponseType\n\n\u003ccode\u003e'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'\u003c/code\u003e\n\n\n### Enums\n\n\n#### ScanDocumentResponseStatus\n\n| Members       | Value                  | Description                       |\n| ------------- | ---------------------- | --------------------------------- |\n| **`Success`** | \u003ccode\u003e'success'\u003c/code\u003e | The scan completed successfully.  |\n| **`Cancel`**  | \u003ccode\u003e'cancel'\u003c/code\u003e  | The user cancelled the scan flow. |\n\n\n#### ResponseType\n\n| Members             | Value                        | Description                                      |\n| ------------------- | ---------------------------- | ------------------------------------------------ |\n| **`Base64`**        | \u003ccode\u003e'base64'\u003c/code\u003e        | Return scanned images as base64-encoded strings. |\n| **`ImageFilePath`** | \u003ccode\u003e'imageFilePath'\u003c/code\u003e | Return scanned images as file paths on disk.     |\n\n\n#### ScannerMode\n\n| Members              | Value                           | Description                                                                                                     |\n| -------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------- |\n| **`Base`**           | \u003ccode\u003e'base'\u003c/code\u003e             | Basic document scanning with crop and rotate features only. No filters or ML-based enhancements.                |\n| **`BaseWithFilter`** | \u003ccode\u003e'base_with_filter'\u003c/code\u003e | Basic features plus automatic filters (grayscale, auto-enhancement).                                            |\n| **`Full`**           | \u003ccode\u003e'full'\u003c/code\u003e             | Full feature set including ML-based image cleaning. Automatically removes stains, fingers, and other artifacts. |\n\n\u003c/docgen-api\u003e\n\n## credits\n\nThis plugin is a re implementation of the original https://document-scanner.js.org\nThanks for the original work, we recoded it with more modern SDK but explodes the same API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-document-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap-go%2Fcapacitor-document-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-document-scanner/lists"}