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

Scandit Class Reference

Classes

class  Barcode
 
class  BarcodePicker
 
class  Callbacks
 
class  CaseCallbacks
 
class  Constraints
 
class  Margins
 
class  MatrixScanSession
 
class  Point
 
class  Quadrilateral
 
class  RecognizedText
 
class  Rect
 
class  ScanCase
 
class  ScanOverlay
 
class  ScanSession
 
class  ScanSettings
 
class  SymbologySettings
 
class  TextRecognitionSettings
 

Detailed Description

Module for all functionality of the barcode recognition plugin.

Since
4.11.0

Class Documentation

class Scandit::Callbacks

A class that holds all the callbacks available in the BarcodePicker.

This class is passed when showing the {}

Class Members
function didScan Callback to be invoked whenever codes have been successfully scanned.

The callback receives the scan session as the first and only argument which contains a list of recognized codes. Zero or more callbacks can be set.

function didManualSearch Callback to be invoked when the user enters a text in the search bar.

The entered text is passed as the first argument to the callback. If you do not use the search bar, you may pass null.

function didCancel Callback to be invoked upon failure, or when cancel is called on the picker.

The callback is passed a reason for failure as the only argument.

function didRecognizeText Callback to be invoked whenever text has been successfully recognized.

The callback receives the {} as the first and only argument.

function didRecognizeNewCodes Callback to be invoked whenever a new code is being tracked by Matrix Scan.

The callback receives the matrix scan session as the first and only argument which contains a list fo newly tracked codes.

function didChangeState Callback that gets invoked whenever the picker changes state, e.g.

when the picker changes from stopped to active, or from active to paused. The argument to the callback is the new state (see {} for possible values).

function didChangeProperty Callback to be invoked whenever the state of the barcode picker changes, e.g.

when the torch is turned on.

The callback receives the name of the changed property as the first argument and the new state of that property as its second argument.

function didFailToValidateLicense Callback to be invoked whenever license validation process fails.

The callback receives a string describing the error as its only argument.

function didProcessFrame Callback to be invoked whenever a new camera frame has been processed and new codes have been recognized within that frame.

The callback receives a base64 string encoding the processed frame. Frame is not rotated - it is in the exact same orientation as the original frame received from the device's camera.

class Scandit::CaseCallbacks

A class that holds all the callbacks available in the ScanCase.

Class Members
function didInitialize Callback to be invoked when SBSScanCase has finished the initialization.
function didScan Callback to be invoked whenever a new code is scanned.
function didChangeState Callback to be invoked whenever ScanCase.State changed.
class Scandit::Constraints

Constraints for the scanner view.

Margins have higher priority than width and height, for example if the horizontal margins and the width are all set, the width is ignored. If the width is set but no horizontal margins are set the plugin will set the left margin to 0. For the same scenario with the vertical margins and height, the top margin will be set to 0.

Since
4.13.1
Class Members
number leftMargin The left margin.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the margin in percent, it is set to the desired percentage of the screen width.

number topMargin The top margin.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the margin in percent, it is set to the desired percentage of the screen height.

number rightMargin The right margin.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the margins in percent, it is set to the desired percentage of the screen width.

number bottomMargin The bottom margin.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the margins in percent, it is set to the desired percentage of the screen height.

number width The width.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the width in percent, it is set to the desired percentage of the screen width.

number height The height.

Can be specified as an integer to mean device independent pixels/points or alternatively as a string with an added '%' at the end. When expressing the height in percent, it is set to the desired percentage of the screen height.

class Scandit::Quadrilateral

A 2-dimensional polygon with 4 corners.

Since
4.11.0
Class Members
Point topLeft Top left corner of the quadrilateral.
Point topRight Top right corner of the quadrilateral.
Point bottomLeft Bottom left corner of the quadrilateral.
Point bottomRight Bottom right corner of the quadrilateral.
class Scandit::RecognizedText

Holds the text recognition result as identified in a frame.

Since
5.3.0
Class Members
String text The recognized text.
boolean rejected Whether this code is rejected or not.

If beeping/vibration is enabled, the device will beep and vibrate whenever text has been recognized. Set this property to true to suppress beeping/vibration. Use this functionality if you want to perform additional checks on the recognized text that can not be expressed through a regular expression.

class Scandit::TextRecognitionSettings

Settings to configure the text recognition.

Since
5.3.0
Class Members
Rect areaPortrait The area (in relative coordinates) in which text is to be recognized.

While it's possible to set this area to the whole image, it is not recommended to do so for speed reasons. For best performance, set this to the smallest possible area. By default, the recognition area is set to 1/4 of the image height.

This value is only used when scanning in portrait orientation. recognitionAreaLandscape is used when scanning in landscape orientation.

Since
5.3.0
Rect areaLandscape The area (in relative coordinates) in which text is to be recognized.

While it's possible to set this area to the whole image, it is not recommended to do so for speed reasons. For best performance, set this to the smallest possible area. By default, the recognition area is set to 1/4 of the image height.

This value is only used when scanning in landscape orientation. recognitionAreaPortrait is used when scanning in portrait orientation.

Since
5.3.0
String regex Regular expression for filtering the recognized characters.

Text that does not match the regular expression is ignored.

By default, the regex is set to null. You must explicitly initialize the regex in order for text recognition to work.

Since
5.3.0
String characterWhitelist White list of recognizable characters.

If the white list is non-null, a recognition result will never contain characters that are not contained in it.

By default the white list is null and all characters will be recognized.

Since
5.3.0