Set Target Barcode Types for Recognition

Overview

Aspose.BarCode for Java supports barcode recognition for 60+ various barcode types. To improve the efficiency of the recognition process and optimize its timing, it is recommended to set target symbologies in advance. Otheriwise, the DecodeType.ALL_SUPPORTED_TYPES setting of the DecodeType enum will be used by default meaning that the library will look over all supported barcode types to check for their presence in the source image. Using this setting will increase the time needed to complete barcode recognition.

List Target Barcode Types in DecodeType

Target barcode types can be specified by grouping them in a list and passing it to the BarCodeReader() constructor or the setBarCodeReadType method.

Use MultyDecodeType Mode

The other way to specify target barcode types is to determine them using a constructor of class MultyDecodeType and then pass it to class BarCodeReader or the setBarCodeReadType method.

Use Predefined Symbology Sets

Class DecodeType provides the following symbology sets for barcode reading:

  • ALL_SUPPORTED_TYPES - all available barcode types
  • TYPES_1D - all supported 1D types
  • TYPES_2D - all supported 2D types
  • POSTAL_TYPES - all available postal types
  • MOST_COMMON_TYPES - a set of most widespread barcode types defined according to Aspose recommendations

The required set can be specified in the BarCodeReader constructor or passed to the setBarCodeReadType method.