Skip to main content
Version: Version 1.0.0

[BarcodeParams] INI file section

Configuration options for detecting, decoding, and customizing the interpretation of various barcode types in the Pdftools OCR Service.


Main settings

Type

KeyTypeDefault
TypeBarcodeTypeEnumBT_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.

note

The default value allows for the detection of barcodes of all supported types. However, we recommend excluding IATA 2 of 5, Interleaved 2 of 5, and Matrix 2 of 5 barcode types unless you are certain that they will occur on your images.
Barcodes of these types do not have a checksum and can therefore be mistakenly found on image areas that do not actually contain any barcodes.

BarcodeTypeEnum

  • BT_Autodetect: Forces the Pdftools OCR Service to automatically detect the barcode type during recognition.
  • 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_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_UCC128: Barcode in GS1-128 standard. The former name is 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

KeyTypeDefault
OrientationBarcodeOrientationEnumBO_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.

MinRatioToTextHeight

KeyTypeDefault
MinRatioToTextHeightdouble-1

This property defines the minimal acceptable height of the barcode relative to the average letter height.
Use this setting if you need to allow the detection of low barcodes.

You can only assign a positive value to this property, or the default value -1.
The upper limit is 2147483647 (2³¹ − 1).

The default value -1 means the Pdftools OCR Service automatically adjusts the setting.


Settings for specific barcode types

CodePage

KeyTypeDefault
CodePageCodePageEnumCP_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 not 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.
Usually, this is the code page of the operating system under that the printer was running.

note

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 Armenian
  • CP_Armenian_Macintosh: Macintosh Armenian
  • CP_Armenian_MSDOS: DOS Armenian
  • CP_Baltic: Windows Baltic (1257)
  • CP_Baltic_ISO: ISO Baltic (8859-4)
  • CP_Baltic_MSDOS: DOS Baltic (775)
  • CP_Bashkir: Windows Bashkir
  • CP_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 Croatian
  • CP_Cyrillic: Windows Cyrillic (1251)
  • CP_Cyrillic_ISO: ISO Cyrillic (8859-5)
  • CP_Cyrillic_Macintosh: Macintosh Cyrillic
  • CP_Cyrillic_MSDOS: DOS Cyrillic (855)
  • CP_Digits: Digits
  • CP_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 1
  • CP_Hebrew: Windows Hebrew (1255)
  • CP_Hebrew_ISO: ISO Hebrew (8859-8)
  • CP_Hebrew_Macintosh: Macintosh Hebrew
  • CP_Hebrew_MSDOS: DOS Hebrew (862)
  • CP_Icelandic_Macintosh: Macintosh Icelandic
  • CP_Japan_Mac: Japanese (Mac)
  • CP_Japan_SJIS: Japanese (Shift-JIS)
  • CP_KOI8: Russian KOI8
  • CP_Korean: Korean
  • CP_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 2
  • CP_Latin5_ISO: ISO Turkish (8859-9)
  • CP_Latin1_MSDOS: DOS Multilingual Latin 1
  • CP_Mathematical: Mathematical symbols (850)
  • CP_Null: Invalid code page
  • CP_Roman_Macintosh: Macintosh Roman
  • CP_Russian_MSDOS: DOS Russian (866)
  • CP_Slavic_MSDOS: DOS Latin 2 (852)
  • CP_Tatar: Windows Tatar
  • CP_Tatar_MSDOS: DOS Tatar
  • CP_Thai: Windows Thai (874)
  • CP_Thai_Macintosh: Macintosh Thai
  • CP_Turkish: Windows Turkish (1254)
  • CP_Turkish_IBM: DOS Turkish (857)
  • CP_Turkish_ISO: ISO Latin 3 (8859-3)
  • CP_Turkish_Macintosh: Macintosh Turkish
  • CP_Ukrainian_Macintosh: Macintosh Ukrainian
  • CP_US_MSDOS: DOS United States (437)
  • CP_Vietnamese: Vietnamese

ContainsBinaryData

KeyTypeDefault
ContainsBinaryDataBooleanfalse

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.


EnableAdvancedExtractionMode

KeyTypeDefault
EnableAdvancedExtractionModeBooleanfalse

This property is only valid for 2D barcodes.

When set to true, it activates advanced barcode extraction mode, allowing detection of barcodes positioned at angles (for example, 45°).
This increases detection accuracy but may slow down processing.


HasChecksum

KeyTypeDefault
HasChecksumBooleanfalse

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.

note

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.


IsCode39WithoutAsterisk

KeyTypeDefault
IsCode39WithoutAsteriskBooleanfalse

Specifies that the Code 39 barcode being recognized has no start and stop symbol (the asterisk “*”).


SupplementType

KeyTypeDefault
SupplementTypeBarcodeSupplementTypeEnumBS_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_Unknown: Denotes an unknown supplementary kind of barcode.
  • BS_Void: No supplementary barcode.