Optical Character Recognition - powered by Tesseract
tns plugin add nativescript-ocr
You'll need to add language files to help Tesseract recognizing text in the images you feed it.
Download version 3.04.00 of the tessdata files here and
add your required language to the
app/tesseract/tessdata/ folder of your app.
Note that if your language(s) has multiple files (like English: there's 9 files matching
eng.*), copy all those files to the folder.
iOS searches for the tessdata folder in
app/App_Resources/iOS, but instead of dulicating the folder
you can create a symbolic link:
cd app/App_Resources/iOSln -s ../../tesseract/tessdata
This is just a basic example using the default settings, look at the TypeScript code below for a more elaborate example.
var OCRPlugin = ;var ocr = ;ocr;
This example shows how to use all possible (but optional) options you can pass into
;;: voidlet img: ImageSource = ;img;}