Changing the Length of the Barcodes to Decode

By default the Scandit Barcode Scanner scans barcodes with a fixed symbol count range. Under certain conditions it is helpful to modify the length of the barcode to be decoded, for example if

  • you want to scan longer codes which can not be decoded with the default settings.
  • to optimize decoder performance for codes of certain lengths; when it is known that the application only requires scanning of particular barcode lengths.

The mapping from characters to symbols is symbology-specific. For some symbologies, the start and end characters are included, others include checksums characters in the symbol counts.

The active symbol count setting is ignored for fixed-size barcodes (the EAN and UPC family of codes) as well as 2d codes. For other symbologies, see Calculating symbol counts for variable-length symbologies.

Change the barcode length

Changing the length of the barcodes is done through SetActiveSymbolCounts(short[]) on the symbology settings object. Following an example of changing for Code 128 barcodes the symbol count range (4-40).

short[] counts = new short[36];
short initLength = 4;
for (int i = 0; i < 36; i++) {
counts[i] = initLength;

Available since SDK version 4.12.0.