0.0.1 • Published 11 months ago

capacitor-docscanner v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

capacitor-docscanner

The capacitor-docscanner allows you to scan documents using the camera on your device. The plugin automatically crops the scanned documents and provides them as Base64-encoded JPEG images.

This plugin leverages Google's ML Kit on Android and Vision API on iOS to perform document scanning and cropping.

Versioning

See the table below for details.

VersionDescriptionCapacitor Version
0.0.1Initial release.6

Install

npm install capacitor-docscanner
npx cap sync

iOS configuration

iOS requires the following usage description be added and filled out for your app in Info.plist:

NSCameraUsageDescription 

API

scan(...)

scan(opts?: DocScanOpts | undefined) => Promise<DocScanResult>

Initiates the document scanning process. This method opens the document scanner and allows the user to scan documents.

ParamTypeDescription
optsDocScanOptsOptional configuration options for the scanning process.

Returns: Promise<DocScanResult>


Interfaces

DocScanResult

The result of a document scanning operation.

PropTypeDescription
imagesstring[]An array of scanned images, each represented as a Base64-encoded JPEG string.

DocScanOpts

Configuration options for the document scanning process.

PropTypeDescription
maxScansnumberThe maximum number of documents that can be scanned. If not provided, the scanner will scan only one Note: This option is only supported on Android, in ios is ignored.