Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Cordova
Motivation
OCR enables text recognition for your mobile scanning apps. This means you can add text recognition to your organization’s mobile data capture workflows. As a result, you can seamlessly switch between reading barcodes and text with the touch of a button. An OCR sample is shipped in the zip file of our OCR SDK.
License Key
A dedicated OCR License key and SDK should be used. Please contact us (https://support.scandit.com/hc/en-us/requests/new) for more details.
Implementing OCR
To integrate the OCR into your Cordova app, follow the simple steps below:
Add callbacks to handle the scanning event
You now need to define the functions that are referenced in the show() call. All functions take one argument.
Set the text scan settings
- Create a Scan Settings and Text Recognition Settings.
- Set the recognition mode to “Text”.
- Specify the format/structure of the text to be scanned: regular expression which matches your text and white list of recognizable characters.
- Set the area in which text is to be recognized.
Instantiate the barcode picker
- Instantiate the barcode picker with the previously created settings.
- Show the picker and set the appropriate callbacks.
- Start scanning.