NeutrinosPlatform/cordova-plugin-mobile-ocr

How do i pass 4 arguments ?

ChaminThilakarathne opened this issue · 6 comments

Hey @Chamiyalt
Where are you getting this documentation from? Also what is plugin version are you using?

Cheers,
Chris
Neutrinos

cordova-plugin-mobile-ocr 3.1.1 "Textocr"

this is the documentation which i followed https://ionicframework.com/docs/native/ocr#usage

I did not create that documentation or the interface ionic uses.
But as far as I can tell, you don't need to pass in success and failure.
OCR.recText is a promise function, so you can just look for the resolve and reject, instead of passing in success and error callback functions.

So I guess the function call might look something like (got this from ionic docs) :-

this.ocr.recText(OCRSourceType.NORMFILEURL, "file://path/to/image.png")
  .then((res: OCRResult) => console.log(JSON.stringify(res)))
  .catch((error: any) => console.error(error));

The link you provided also backs up my claim. There is an example there. Try using the same example.

Cheers,
Chris
Neutrinos

It was worked. Thanks a lot.

Awesome!

Cheers,
Chris
Neutrinos