BarcodeScanner


Purpose

Consists of the barcode scanner object.

The barcode scanning process is started by calling the scan method below. A full-screen live camera preview is displayed, with a rectangular scanning area. The barcode scanner continuously analyses the scanning area until it detects a valid barcode or the scan is cancelled. The preview screen is automatically closed when a barcode is successfully read or the scan is cancelled.

Use the launchbox.BarcodeScanner reference to obtain an instance of this object.

Module

This object belongs to the Barcode Scanner product module.

Constants

The values below are used by the scanMode setting of the scan method.

Name Description
SCAN_MODE_ALL The scanner will attempt to detect all supported barcode types. This is the default mode.
SCAN_MODE_PRODUCT The scanner will attempt to detect all product type barcodes. The supported barcode formats are: FORMAT_UPC_A, FORMAT_UPC_E, FORMAT_EAN_8, FORMAT_EAN_13.
SCAN_MODE_1D The scanner will attempt to detect all one dimensional (1D) type barcodes. The supported barcode formats are: FORMAT_UPC_A, FORMAT_UPC_E, FORMAT_EAN_8, FORMAT_EAN_13, FORMAT_CODE_39, FORMAT_CODE_128, FORMAT_ITF.
SCAN_MODE_QR_CODE The scanner will attempt to detect QR CODE type barcodes. The supported barcode format is: FORMAT_QR_CODE.
SCAN_MODE_DATA_MATRIX The scanner will attempt to detect DATA MATRIX type barcodes. The supported barcode format is: FORMAT_DATA_MATRIX.

Note

The following values are supported on Android devices only: FORMAT_UPC_A, FORMAT_ITF. The following values are supported on iOS devices only: FORMAT_39_MOD_43, FORMAT_AZTEC, FORMAT_CODE_93, FORMAT_INTERLEAVED_2_OF_5, FORMAT_ITF_14.

The values below are used by the characterSet setting of the scan method.

Name Description
ENCODING_SHIFT_JIS The scanner will attempt to decode barcode data using the Shift-JIS encoding.
ENCODING_UTF_8 The scanner will attempt to decode barcode data using the UTF-8 encoding.
ENCODING_ISO_8859_1 The scanner will attempt to decode barcode data using the ISO-8859-1 encoding.

The values below are used on iOS by the cameraType setting of the scan method.

Name Description
CAMERA_TYPE_BACK The scanner will attempt to scan barcodes using the device's main camera. This is the default setting.
CAMERA_TYPE_FRONT The scanner will attempt to scan barcodes using the device's front camera

The table below lists barcode int values returned by the onSuccess callback method.

Value Description
-1 Unknown barcode format
0 QR Code 2D
1 Data Matrix 2D
2 UPC-E 1D
3 UPC-A 1D
4 EAN-8 1D
5 EAN-13 1D
6 Code 128 1D
7 Code 39 1D
8 ITF 1D
9 PDF417
10 Code 93 1D
11 AZTEC 2D
16 Code 39 Mod 43
17 Interleaved 2 of 5
18 ITF 14

One of the following constants is passed in the error object passed to the onFailure callback method to define the type of authentication failure.

Name Description
INTERNAL_ERROR Denotes that an internal error has occurred.
SCANNER_ERROR Denotes that the scanning operation has failed due to a scanner-related error.

Methods

Name Description Return type
scan

Launches the barcode scanning process and displays the full-screen live camera preview.

undefined

Related topics

Public API reference
Legal notice | Copyright © 2018 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...