[BarcodeParams] INI file section
The [BarcodeParams] INI file section defines parameters for barcode detection and recognition. These parameters are only used when the DetectBarcodes property in the [PageAnalysisParams] section is set to true.
Main settings
EnableBarcodesCheck
| Key | Type | Default |
|---|---|---|
EnableBarcodesCheck | Boolean | true |
Specifies whether the barcode checking classifier can be used. This classifier verifies if there are barcodes on the image. This property doesn’t work with postal barcodes.
Type
| Key | Type | Default |
|---|---|---|
Type | BarcodeTypeEnum | BT_Autodetect |
The value of this property is an OR superposition of the BarcodeTypeEnum enumeration constants that denote the types of barcodes.
For example, if it is set to BT_EAN13 | BT_EAN8, the Pdftools OCR Service tries to recognize barcode blocks in either EAN 13 or EAN 8 standard, ignoring all other variants.
By default, this property is set to BT_Autodetect, the Pdftools OCR Service detects the barcode type automatically.
The default value allows detection of all supported barcode types. However, consider removing IATA 2 of 5, Interleaved 2 of 5, and Matrix 2 of 5 barcode types unless you’re certain they occur on your images. Barcodes of these types don’t have a checksum and can be mistakenly found on image areas that don’t actually contain barcodes.
BarcodeTypeEnum
BT_Autodetect: Forces the Pdftools OCR Service to automatically detect the barcode type during recognition.BT_AutodetectWithoutPostal: Automatically detects the barcode type during recognition, except postal types.BT_Australia4State: Barcode in Australia 4-State standard.BT_Aztec: Barcode in Aztec standard.BT_Codabar: Barcode in Codabar standard.BT_Code128: Barcode in Code 128 standard.BT_Code32: Barcode in Code 32 standard.BT_Code39: Barcode in Code 39 standard.BT_Code93: Barcode in Code 93 standard.BT_DataMatrix: Barcode in Data Matrix standard.BT_EAN13: Barcode in EAN 13 standard.BT_EAN8: Barcode in EAN 8 standard.BT_FullAscii: Barcode in Full ASCII Code 39 standard.BT_IATA25: Barcode in IATA 2 of 5 standard.BT_Industrial25: Barcode in Industrial 2 of 5 standard.BT_IntelligentMail: Barcode in Intelligent Mail standard.BT_Interleaved25: Barcode in Interleaved 2 of 5 standard.BT_JapanPost: Barcode in Japan Post standard.BT_KIX: Barcode in KIX standard.BT_Matrix25: Barcode in Matrix 2 of 5 standard.BT_MaxiCode: Barcode in MaxiCode standard.BT_Patch: Barcode in Patch standard.BT_PDF417: Barcode in PDF417 standard.BT_PostNet: Barcode in PostNet standard.BT_QRCode: Barcode in QR Code standard.BT_RoyalMail4State: Barcode in Royal Mail 4-State standard.BT_UCC128: Barcode in GS1-128 standard. Formerly called UCC-128.BT_Unknown: Denotes an unknown type of barcode.BT_UPCA: Barcode in UPC-A standard.BT_UPCE: Barcode in UPC-E standard.
Orientation
| Key | Type | Default |
|---|---|---|
Orientation | BarcodeOrientationEnum | BO_Autodetect |
The value of this property is an OR superposition of the BarcodeOrientationEnum constants which define barcode orientations.
For example, if set to BO_Left_To_Right | BO_Down_To_Top, the Pdftools OCR Service assumes barcode blocks may be oriented either from left to right or from down to top, ignoring all others.
BarcodeOrientationEnum
BO_Autodetect: Detect the barcode orientation automatically.BO_Down_To_Top: Barcode is oriented from down to top.BO_Left_To_Right: Barcode is oriented from left to right.BO_Right_To_Left: Barcode is oriented from right to left.BO_Top_To_Down: Barcode is oriented from top to down.BO_Unknown: Denotes an unknown type of barcode orientation.
Settings for specific barcode types
CodePage
| Key | Type | Default |
|---|---|---|
CodePage | CodePageEnum | CP_Null |
This property is used to recognize PDF417, Aztec, Data Matrix, QR Code, and MaxiCode barcodes that do not conform to the barcode specifications. Do not use this property for barcodes that do conform to the specifications.
Some barcode printers use code pages that are different from those defined in the barcode standard. In such cases, use this property to specify the code page that was used by the barcode printer to create the barcode. In most cases, this is the code page of the operating system the printer was running on.
The following code pages are required by the specifications:
- For PDF417: DOS United States (437):
CP_US_MSDOS - For Aztec, DataMatrix, QR Code, MaxiCode: ISO Latin 1 (8859-1):
CP_Latin_ISO
This property is used to convert recognized barcode data into a Unicode string.
By default, this property is set to CP_Null, which means that the code page required by the specification should be used.
CodePageEnum
CP_Armenian: Windows ArmenianCP_Armenian_Macintosh: Macintosh ArmenianCP_Armenian_MSDOS: DOS ArmenianCP_Baltic: Windows Baltic (1257)CP_Baltic_ISO: ISO Baltic (8859-4)CP_Baltic_MSDOS: DOS Baltic (775)CP_Bashkir: Windows BashkirCP_Chinese_Simpl_GB: Chinese Simplified (GB2312)CP_Chinese_Simpl_Mac: Chinese Simplified (Mac)CP_Chinese_Trad_Big: Chinese Traditional (Big5)CP_Chinese_Trad_Mac: Chinese Traditional (Mac)CP_Croatian_Macintosh: Macintosh CroatianCP_Cyrillic: Windows Cyrillic (1251)CP_Cyrillic_ISO: ISO Cyrillic (8859-5)CP_Cyrillic_Macintosh: Macintosh CyrillicCP_Cyrillic_MSDOS: DOS Cyrillic (855)CP_Digits: DigitsCP_EasternEuropean: Windows Central Europe (1250)CP_EasternEuropean_ISO: ISO Central Europe (8859-2)CP_Greek: Windows Greek (1253)CP_Greek_737: DOS Greek (737)CP_Greek_869: DOS Modern Greek (869)CP_Greek_ISO: ISO Greek (8859-7)CP_Greek_Macintosh: Macintosh Greek 1CP_Hebrew: Windows Hebrew (1255)CP_Hebrew_ISO: ISO Hebrew (8859-8)CP_Hebrew_Macintosh: Macintosh HebrewCP_Hebrew_MSDOS: DOS Hebrew (862)CP_Icelandic_Macintosh: Macintosh IcelandicCP_Japan_Mac: Japanese (Mac)CP_Japan_SJIS: Japanese (Shift-JIS)CP_KOI8: Russian KOI8CP_Korean: KoreanCP_Korean_Johab: Korean (Johab)CP_Korean_Mac: Korean (Mac)CP_Latin: Windows Western Europe (1252)CP_Latin_ISO: ISO Latin 1 (8859-1)CP_Latin2_Macintosh: Macintosh Latin 2CP_Latin5_ISO: ISO Turkish (8859-9)CP_Latin1_MSDOS: DOS Multilingual Latin 1CP_Mathematical: Mathematical symbolsCP_Null: Invalid code pageCP_Roman_Macintosh: Macintosh RomanCP_Russian_MSDOS: DOS Russian (866)CP_Slavic_MSDOS: DOS Latin 2 (852)CP_Tatar: Windows TatarCP_Tatar_MSDOS: DOS TatarCP_Thai: Windows Thai (874)CP_Thai_Macintosh: Macintosh ThaiCP_Turkish: Windows Turkish (1254)CP_Turkish_IBM: DOS Turkish (857)CP_Turkish_ISO: ISO Latin 3 (8859-3)CP_Turkish_Macintosh: Macintosh TurkishCP_Ukrainian_Macintosh: Macintosh UkrainianCP_US_MSDOS: DOS United States (437)
ContainsBinaryData
| Key | Type | Default |
|---|---|---|
ContainsBinaryData | Boolean | false |
This property is relevant only for barcodes like PDF417, Aztec, Data Matrix, and QR Code that encode some binary data. It affects how binary data is represented in the recognized output.
If set to true, the binary data in the barcode is saved as a sequence of hexadecimal values for corresponding bytes.
If set to false, the binary data is translated to a Unicode string using the code page specified in the CodePage property.
HasChecksum
| Key | Type | Default |
|---|---|---|
HasChecksum | Boolean | false |
Specifies whether the barcode must be interpreted with a checksum. Only applicable for Code 39, Interleaved 2 of 5, Codabar, and Matrix 2 of 5.
While Codabar has no check digit, Pdftools OCR Service uses a Modulo 16 algorithm to compute one. Each Codabar character has a value. The sum of all values (including Start/Stop characters) is computed, and the check digit is a value that brings this total to a multiple of 16.
SupplementType
| Key | Type | Default |
|---|---|---|
SupplementType | BarcodeSupplementTypeEnum | BS_Autodetect |
This property defines the type of supplementary barcode for EAN-8, EAN-13, UPC-A, and UPC-E barcodes.
It is an OR combination of BarcodeSupplementTypeEnum values.
For example, setting it to BS_Void or BS_2Digits lets the Pdftools OCR Service try to recognize barcodes either with no supplement or with a 2-digit supplement.
BarcodeSupplementTypeEnum
BS_2Digits: 2-digit supplementary barcode.BS_5Digits: 5-digit supplementary barcode.BS_Autodetect: Automatically detect the supplementary barcode type.BS_Void: No supplementary barcode.