@jcesarmobile/capacitor-ocr
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@jcesarmobile/capacitor-ocr

Capacitor plugin for Optical Character Recognition (OCR). It does in device text recognition. On iOS it uses Vision framework provided by Apple. On Android it uses mlkit provided by Google. It has a dependency to com.google.mlkit:text-recognition, default version is 16.0.1, but can be configured with a textRecognitionVersion variable in your variables.gradle file.

Install

npm install @jcesarmobile/capacitor-ocr
npx cap sync

Example

An example app is available in example-app folder.

API

process(...)

process(options: { image: string; }) => Promise<RecognitionResults>

Process the text on the provided image. Only file urls (as the ones returned by Camera plugin) are supported at the moment.

Param Type
options { image: string; }

Returns: Promise<RecognitionResults>


Interfaces

RecognitionResults

Prop Type Description Since
results RecognitionResult[] List of recognized texts 1.0.0

RecognitionResult

Prop Type Description Since
text string The recognized text. 1.0.0
confidence number The confidence of the recognized text. 1.0.0

Package Sidebar

Install

npm i @jcesarmobile/capacitor-ocr

Weekly Downloads

5

Version

0.0.1

License

MIT

Unpacked Size

19.3 kB

Total Files

21

Last publish

Collaborators

  • jcesarmobile