Image to Text Plugin

This plugin allows you to use ocr to get text from an image.

Limitations:

Only works on iOS and Android.

How Do I add a Traineddata or Language?:

on iOS due to limitation of the Tessract Api on iOS, you are limited to

  • "chi_sim" aka chinese simplified
  • "eng" aka english
  • "fra" aka french
  • "jpn" aka japanese
  • "kor" aka korean
  • "por" aka portuguese
  • "rus" aka russian
  • "spa" aka spanish

if you want to use your own traineddata on iOS, please use Corona Enterpise and Contact me for Plugin Binaries. If you using android you need to load the traineddata data manually, traineddata I use for iOS are found here and can be used for Android if wanted. In order to load traineddata on android, the data is moved to the phones hard drive , which is required by tessarct Api on android, it is put in phoneHardDrivePath/OCRFolder. In order to load traineddata in just use the following snippet of code

Functions:

imageToText.init(listener)

listener (function) returns event.response with the converted text.

imageToText.convert(pathToImage, language)

pathToImage (path) path to png or jpeg via system.pathForFile()

language (string) the language or traineddata to scan for in image

imageToText.listLanguages()

returns an array of strings of languages loaded on the app (note .traineddata is not included)

imageToText.transferLanguage(path) (Used for android)

path (path) path to .traineddata to be loaded for converting via system.pathForFile()

also returns string for status, this includes: "file saved", "could not find language folder", "could not save file to language folder", or "unable to create language directory"

imageToText.deleteLanguage(language) (Used for android)

language (string) language or traineddata to be removed from phone hard drive. (note should not include .traineddata in string)

Build.settings

Helpful Links:

Example

Support

Get Plugin