0.0.1 • Published 6 months ago
@jcesarmobile/capacitor-ocr v0.0.1
@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 syncExample
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 |
0.0.1
6 months ago