Skip to content

Pantrist-dev/capacitor-plugin-ml-kit-text-recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7246051 · Mar 20, 2025

History

45 Commits
Mar 7, 2025
Mar 7, 2025
Sep 6, 2024
Mar 17, 2022
Feb 12, 2025
Mar 20, 2025
Mar 17, 2022
May 19, 2022
Mar 7, 2025
Mar 7, 2025
Dec 20, 2022
Mar 7, 2025
Mar 20, 2025
Mar 20, 2025
Mar 17, 2022

Repository files navigation

@pantrist/capacitor-plugin-ml-kit-text-recognition

npm version npm downloads per month

Capacitor Wrapper for TextRecognition of Googles ML-Kit

Install

npm install @pantrist/capacitor-plugin-ml-kit-text-recognition
npx cap sync

Configuration

Android

Optional but recommended: You can configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app's AndroidManifest.xml file:

<application ...>
  ...
  <meta-data
      android:name="com.google.mlkit.vision.DEPENDENCIES"
      android:value="ocr" />
  <!-- To use multiple models: android:value="ocr,model2,model3" -->
</application>

iOS

Nothing to do for iOS

Supported methods

Name Android iOS Web
detectText

API

detectText(...)

detectText(options: DetectImageOptions) => Promise<TextDetectionResult>

Tries to detect text from the given image

Param Type Description
options DetectImageOptions Options for the text detection

Returns: Promise<TextDetectionResult>


Interfaces

TextDetectionResult

Prop Type Description
text string Found text
blocks Block[] Parsed text by lines

Block

Prop Type
lines Line[]

Line

Prop Type
elements Element[]

Element

DetectImageOptions

Prop Type Description
base64Image string The image to detect texts from
rotation number The image's counter-clockwise orientation degrees. Only 0, 90, 180, 270 are supported. Default 0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4