/document-scanner

Primary LanguageSwiftMIT LicenseMIT


Document Scanner

@kodista/document-scanner

Scan documents using the ios Visions framework to correct perspective and do OCR.

Maintainers

Maintainer GitHub Social
Roman rspy not social ;-)

Installation

npm install https://github.com/kodista/document-scanner.git#release/0.0.1
npx cap sync

Configuration

iOS

For iOS you need to set a usage description in your info.plist file.

This can be done by either adding it to the Source Code directly or by using Xcode Property List inspector.

Adding it to the source code directly

  1. Open up the Info.plist (in Xcode right-click > Open As > Source Code)
  2. With <dict></dict> change the following
<dict>
+  <key>NSCameraUsageDescription</key>
+  <string>To be able to scan documents</string>
</dict>

NOTE: "To be able to scan documents" can be substituted for anything you like.

Adding it by using Xcode Property List inspector

  1. Open up the Info.plist in Xcode (right-click > Open As > Property List)
  2. Next to "Information Property List" click on the tiny + button.
  3. Under key, type "Privacy - Camera Usage Description"
  4. Under value, type "To be able to scan documents"

NOTE: "To be able to scan documents" can be substituted for anything you like.

More info here: https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription

Usage

const scanResult: ScanResult = await Plugins.DocumentScanner.scan({
  resultType: 'uri',
  textRecognitionLanguages: ['de-CH', 'en-US']
} as ScanOptions);