0.0.5 • Published 4 months ago

mdocument-scanner v0.0.5

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

mdocument-scanner

Document scanner - This is a Capacitor plugin that lets you scan documents using Android and iOS.

Install

npm install mdocument-scanner
npx cap sync

Android Configuration

Add these lines to android/app/src/main/res/xml/file_paths.xml

<?xml version="1.0" encoding="utf-8" ?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-path name="external_files" path="."/>
    <cache-path name="mlkit_docscan_ui_client" path="." />
</paths>

iOS Configuration

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

NSCameraUsageDescription (Privacy - Camera Usage Description)

API

scanDocument(...)

scanDocument(options: ScanDocumentOptions) => Promise<ScanDocumentResponse>
ParamType
optionsScanDocumentOptions

Returns: Promise<ScanDocumentResponse>


Interfaces

ScanDocumentResponse

PropTypeDescription
scannedFilestringThis is an array with either file path or base64 for the document scan.
statusScanDocumentResponseStatusThe status lets you know if the document scan completes successfully, or if the user cancels before completing the document scan.

ScanDocumentOptions

PropTypeDescriptionDefault
maxNumDocumentsnumberAndroid only: The maximum number of photos an user can take (not counting photo retakes): 1
responseTypeResponseTypeThe response comes back in this format on success. It can be the document scan image file paths or base64 images.: ResponseType.ImageFilePath

Enums

ScanDocumentResponseStatus

MembersValueDescription
Success'success'The status comes back as success if the document scan completes successfully.
Cancel'cancel'The status comes back as cancel if the user closes out of the camera before completing the document scan.

ResponseType

MembersValueDescription
Base64'base64'Use this response type if you want document scan returned as base64 images.
ImageFilePath'imageFilePath'Use this response type if you want document scan returned as inmage file paths.
acornacorn-jsxajvansi-colorsansi-regexansi-stylesargparsearray-buffer-byte-lengtharray-includesarray-unionarray.prototype.findlastindexarray.prototype.flatarray.prototype.flatmaparraybuffer.prototype.sliceastral-regexat-least-nodeavailable-typed-arraysbalanced-matchbrace-expansionbracescall-bindcallsiteschalkchevrotaincolor-convertcolor-namecoloretteconcat-mapcosmiconfigcross-spawndata-view-bufferdata-view-byte-lengthdata-view-byte-offsetdebugdeep-isdefine-data-propertydefine-propertiesdir-globdoctrineemoji-regexenquirererror-exes-abstractes-define-propertyes-errorses-object-atomses-set-tostringtages-shim-unscopableses-to-primitiveescape-string-regexpeslint-config-prettiereslint-import-resolver-nodeeslint-module-utilseslint-plugin-importeslint-scopeeslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsfast-deep-equalfast-globfast-json-stable-stringifyfast-levenshteinfastqfile-entry-cachefill-rangeflat-cacheflattedfor-eachfs-extrafs.realpathfunction-bindfunction.prototype.namefunctional-red-black-treefunctions-have-namesget-intrinsicget-stdinget-symbol-descriptiongithub-sluggerglobglob-parentglobalsglobalthisglobbygopdgraceful-fshas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtaghasownignoreimport-freshimurmurhashinflightinheritsinternal-slotis-array-bufferis-arrayishis-bigintis-boolean-objectis-callableis-core-moduleis-data-viewis-date-objectis-extglobis-fullwidth-code-pointis-globis-negative-zerois-numberis-number-objectis-regexis-shared-array-bufferis-stringis-symbolis-typed-arrayis-weakrefisarrayisexejava-parserjs-tokensjs-yamljson-bufferjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson5jsonfilekeyvlevnlines-and-columnslodashlodash.mergelodash.truncatemerge2micromatchminimatchminimistmsnatural-compareobject-inspectobject-keysobject.assignobject.fromentriesobject.groupbyobject.valuesonceoptionatorparent-moduleparse-jsonpath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpossible-typed-array-namesprelude-lsprogresspunycodequeue-microtaskregexp-to-astregexp.prototype.flagsregexpprequire-from-stringresolveresolve-fromreusifyrun-parallelsafe-array-concatsafe-regex-testsemverset-function-lengthset-function-nameshebang-commandshebang-regexside-channelsignal-exitslashslice-ansisprintf-jsstring-widthstring.prototype.trimstring.prototype.trimendstring.prototype.trimstartstrip-ansistrip-bomstrip-json-commentssupports-colorsupports-preserve-symlinks-flagtabletext-tableto-regex-rangetree-killtsconfig-pathstslibtsutilstype-checktype-festtyped-array-buffertyped-array-byte-lengthtyped-array-byte-offsettyped-array-lengthunbox-primitiveuniversalifyuntildifyuri-jsv8-compile-cachewhichwhich-boxed-primitivewhich-typed-arrayword-wrapwrap-ansiwrappyyaml
0.0.5

4 months ago

0.0.4

10 months ago

0.0.1-beta09

11 months ago

0.0.1-beta08

11 months ago

0.0.1-beta07

11 months ago

0.0.1-beta06

11 months ago

0.0.1-beta05

11 months ago

0.0.1-beta04

11 months ago

0.0.1-beta03

11 months ago

0.0.1-beta02

11 months ago

0.0.1-beta01

11 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago