cordova-plugin-tesseract icon indicating copy to clipboard operation
cordova-plugin-tesseract copied to clipboard

TesseractPlugin is not defined

Open VitorHFLopes opened this issue 9 years ago • 8 comments

I don't know if is an issue or if I'm doing something wrong, but I'm getting "TesseractPlugin is not defined" when I try to call TesseractPlugin.loadLanguage or TesseractPlugin.recognizeText.

The project is building with success, but I'm having this problem, could someone help me?

VitorHFLopes avatar Nov 09 '16 12:11 VitorHFLopes

Seems like you don't have this cordova-plugin-tesseract installed. Or maybe you just need to build your project again to make sure it was included.

Check if you have it installed by running following command on your terminal (inside your project folder): $ cordova plugin list

It should show cordova-plugin-tesseract in the list. If it's not, make sure to follow all steps in the README.

gustavomazzoni avatar Nov 09 '16 13:11 gustavomazzoni

Hi,

I am trying to add this library to my project. i successfully added to my ionic-v2 project. everything is done but still i cannot use it. getting same problem.

Please advise what to do to resolve this "TesseractPlugin is not defined" issue.

please find below result from suggested command too

$ cordova plugin list

com.googlemaps.ios 2.1.1 "Google Maps SDK for iOS" cordova-plugin-compat 1.1.0 "Compat" cordova-plugin-console 1.0.5 "Console" cordova-plugin-device 1.1.4 "Device" cordova-plugin-file 4.3.1 "File" cordova-plugin-googlemaps 1.4.0 "phonegap-googlemaps-plugin" cordova-plugin-http 1.2.0 "SSL Pinning" cordova-plugin-splashscreen 4.0.1 "Splashscreen" cordova-plugin-statusbar 2.2.1 "StatusBar" cordova-plugin-tesseract 0.0.1 "Tesseract Plugin"

please help.

kamalkrjain avatar Jan 16 '17 10:01 kamalkrjain

I have the same problem. TesseractPlugin is not defined. I believe I solved mine by calling window.TesseractPlugin. Now I'm getting errors "ReferenceError: deferred is not defined"

Brain2000 avatar Feb 20 '17 22:02 Brain2000

@Brain2000 The deferred thing is just an example object of deferred callback function.

boltex avatar May 15 '17 18:05 boltex

Any solution for this???

juanka1985 avatar Jul 12 '17 19:07 juanka1985

Any Solution?

hamza-iqbal-hi avatar Sep 24 '17 07:09 hamza-iqbal-hi

Hey Please reply I am getting this Error : Cannot read property 'loadLanguage' I am using (window).TesseractPlugin.loadLanguage(language, function(response) { console.log('language', response); }, function(reason) { console.log('Error on loading OCR file for your language. ' + reason); });

IanDsouza avatar Nov 27 '17 14:11 IanDsouza

Have you tried on a device?

Try these steps :-

  1. Create blank Ionic Project in terminal ionic start myproject blank

  2. Add plugin to project ionic cordova plugin add cordova-plugin-tesseract

  3. Now navigate to E:\myproject\src\app\app.component.ts

    • add declare var TesseractPlugin; above @Component({..
    • then inside platform.ready().then(() => { } function add the functions as shown in readme.
  4. Then in terminal ionic cordova run android

This knowledge is from here. It worked with another plugin. I will try it with this plugin soon and let you guys know if I have any luck. In the meantime posted this solution here for anyone looking for it.

Cheers, Chris Neutrinos

ChrisTomAlx avatar Jun 06 '18 12:06 ChrisTomAlx