BarcodeSettings

BarcodeSettings

The main BarCode decoding parameters. Contains parameters which make influence on recognized data.

Constructor

new BarcodeSettings(settings)

BarcodeSettings copy constructor
Parameters:
Name Type Description
settings The source of the data
Source:

Methods

getAustraliaPost()

Gets AustraliaPost decoding parameters
Returns:
Type Description
The AustraliaPost decoding parameters which make influence on recognized data of AustraliaPost symbology
Source:

getChecksumValidation()

Enable checksum validation during recognition for 1D and Postal barcodes.
Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
Checksum always used: Rest symbologies
Returns:
Type Description
Enable checksum validation during recognition for 1D and Postal barcodes.
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
generator.save("c:/test.png", BarcodeImageFormat.PNG);
let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
//checksum disabled
reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
reader.readBarCodes().forEach(function(result, i, results)
{
     console.log ("BarCode CodeText: " + result.getCodeText());
     console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
});
let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
//checksum enabled
reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
reader.readBarCodes().forEach(function(result, i, results)
{
     console.log ("BarCode CodeText: " + result.CodeText);
     console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
});

getDetectEncoding()

The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.
Returns:
Type Description
The flag which force engine to detect codetext encoding for Unicode codesets
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.QR, "Слово"))
im = generator.generateBarcodeImage(BarcodeImageFormat.PNG);

//detects encoding for Unicode codesets is enabled
let reader = new BarCodeReader(im, DecodeType.QR);
reader.getBarcodeSettings().setDetectEncoding(true);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});
//detect encoding is disabled
let reader = new BarCodeReader(im, DecodeType.QR);
reader.getBarcodeSettings().setDetectEncoding(false);
reader.readBarCodes().forEach(function(result, i, results)
console.log ("BarCode CodeText: " + result.getCodeText());

getStripFNC()

Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
Returns:
Type Description
Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
generator.save("c:/test.png", BarcodeImageFormat.PNG);
let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);

//StripFNC disabled
reader.getBarcodeSettings().setStripFNC(false);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);

//StripFNC enabled
reader.getBarcodeSettings().setStripFNC(true);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});

setChecksumValidation(value)

Enable checksum validation during recognition for 1D and Postal barcodes.
Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
Checksum always used: Rest symbologies
Parameters:
Name Type Description
value Enable checksum validation during recognition for 1D and Postal barcodes.
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
generator.save("c:/test.png", BarcodeImageFormat.PNG);
let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
//checksum disabled
reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
reader.readBarCodes().forEach(function(result, i, results)
{
     console.log ("BarCode CodeText: " + result.getCodeText());
     console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
});
let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
//checksum enabled
reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
reader.readBarCodes().forEach(function(result, i, results)
{
     console.log ("BarCode CodeText: " + result.CodeText);
     console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
     console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
});

setDetectEncoding()

The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.
Returns:
Type Description
The flag which force engine to detect codetext encoding for Unicode codesets
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.QR, "Слово"))
im = generator.generateBarcodeImage(BarcodeImageFormat.PNG);

//detects encoding for Unicode codesets is enabled
let reader = new BarCodeReader(im, DecodeType.QR);
reader.getBarcodeSettings().setDetectEncoding(true);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});
//detect encoding is disabled
let reader = new BarCodeReader(im, DecodeType.QR);
reader.getBarcodeSettings().setDetectEncoding(false);
reader.readBarCodes().forEach(function(result, i, results)
console.log ("BarCode CodeText: " + result.getCodeText());

setStripFNC(value)

Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
Parameters:
Name Type Description
value Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
Source:
Examples
let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
generator.save("c:/test.png", BarcodeImageFormat.PNG);
let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);

//StripFNC disabled
reader.getBarcodeSettings().setStripFNC(false);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});
let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);

//StripFNC enabled
reader.getBarcodeSettings().setStripFNC(true);
reader.readBarCodes().forEach(function(result, i, results)
{
    console.log ("BarCode CodeText: " + result.getCodeText());
});