BARCODE1D

typedef struct _tagBarCode1D
{
   L_UINT uStructSize;
   L_BOOL bOutShowText; 
   L_INT nDirection; 
   L_BOOL bErrorCheck;
   L_INT nGranularity; 
   L_INT nMinLength; 
   L_INT nMaxLength;
   L_INT nWhiteLines;
   L_UINT uStd1DFlags;
   L_UINT uAdvancedFlags;
   L_INT nXModule;
} BARCODE1D,* pBARCODE1D;

This structure contains linear (1D) barcode information for reading or writing 1D bar codes.

Member

Description

uStructSize

Size of BARCODE1D structure in bytes. Use the sizeof operator to calculate this value.

bOutShowText

Indicates whether the barcode string will be shown or not. This member is valid for the LBarcode::Write function. Possible values are:

 

Value

Meaning

 

TRUE

The barcode string will be shown.

 

FALSE

The barcode string will not be shown.

 

nDirection

Flag that indicates the orientation and direction for reading barcodes. This member is valid for the LBarcode::Read. You can combine values when appropriate, by using a bitwise OR ( | ). Possible values are :

 

Value

Meaning

 

BARCODE_DIR_LEFT_TO_RIGHT

[0x001] To read from left to right across the bitmap.

 

BARCODE_DIR_RIGHT_TO_LEFT

[0x002] To read from right to left across the bitmap.

 

BARCODE_DIR_TOP_TO_BOTTOM

[0x004] To read from top to bottom across the bitmap.

 

BARCODE_DIR_BOTTOM_TO_TOP

[0x008] To read from bottom to top across the bitmap.

 

BARCODE_DIR_SKEW

[0x010] To read in a skewed or diagonal direction.

 

BARCODE_DIR_HORIZONTAL

[0x020] To read horizontally (left to right and right to left).

 

BARCODE_DIR_VERTICAL

[0x040] To read vertically (top to bottom and bottom to top).

 

BARCODE_DIR_DIAGONAL

[0x080] To read in a diagonal or skewed direction.

bErrorCheck

Enables or disables the use of an error check digit while reading or writing a bar code.

nGranularity

Number of scanned lines per column to skip when reading a barcode. 9 is the default value. This means that each tenth line will be scanned when looking for a barcode. Scanning every line will slow the search process while skipping too many lines may skip over the barcode. This member is valid for the LBarcode::Read function.

nMinLength

The minimum length of a barcode string when searching for a non fixed length bar code. A value of 0 sets the engine to the default length of 4 characters. The minimum number of characters is 1 and the maximum 63. This member is valid for the LBarcode::Read function.

nMaxLength

The maximum length of a barcode string This must be no greater than 64.

nWhiteLines

The number of lines of white space above and below the barcode symbol.

nXModule

Specifies the size of the smallest bar to write, in thousandths of an inch (0.001), if BARCODE_1D_USE_XMOD flag is set. This flag is available in LEADTOOLS version 16.

 

uStd1DFlags

Flags that indicate the MSI barcode type, Code11 barcode type, and reading speed. You can use a bitwise OR (|) to specify one flag from each group.

MSI barcode type to be read or written:

 

Value

Meaning

 

BARCODE_1D_TYPE_MSI_MOD10

[0x000] MSI (Modified Plessey) type with Modulo 10 check digit.

 

BARCODE_1D_TYPE_MSI_2MOD10

[0x001] MSI (Modified Plessey) type with two Modulo 10 check digits.

 

BARCODE_1D_TYPE_MSI_MOD11

[0x002] MSI (Modified Plessey) type with Modulo 11 check digit.

 

BARCODE_1D_TYPE_MSI_MOD11MOD10

[0x003] MSI (Modified Plessey) type with Modulo 11 and Modulo 10 check digits.

 

Code11 barcode type to be read or written:

 

Value

Meaning

 

BARCODE_1D_TYPE_CODE11_C

[0x000] Code 11(USD-8) type with C check digit only.

 

BARCODE_1D_TYPE_CODE11_K

[0x010] Code 11(USD-8) type with C and K check digits. It is recommended to be used if the message is 10 characters or longer.

 

Reading speed flags (for reading only):

 

Value

Meaning

 

BARCODE_1D_FAST

[0x000] Fast barcode reading (recommended). It is suitable for most barcode qualities either good or poor.

 

BARCODE_1D_NORMAL

[0x100] Fast but a little bit slower than the BARCODE_1D_FAST option, suitable for very poor barcode quality.

 

Code 128 encoding table to be used in barcode writing (for writing Code 128 only):

 

Value

Meaning

 

BARCODE_1D_CODE128_ENCODE_AUTO

[0x000] Automatically encode the barcode data using one or multiple Code 128 encoding tables. This encodes all Code 128 data.

 

BARCODE_1D_CODE128_ENCODE_A

[0x200] Use only Code 128 A table to encode the barcode data. If the barcode data have values not included in the standard Code 128 A table ERROR_BARCODE_STRING will be returned.

 

BARCODE_1D_CODE128_ENCODE_B

[0x400] Use only Code 128 B table to encode the barcode data. If the barcode data have values not included in the standard Code 128 B table ERROR_BARCODE_STRING will be returned.

 

BARCODE_1D_CODE128_ENCODE_C

[0x600] Use only Code 128 C table to encode the barcode data. it encodes only even number of digits. If the barcode data have values not included in the standard Code 128 C table or have an odd number of digits ERROR_BARCODE_STRING will be returned.

 

The position of the barcode's text for writing a standard linear (1D) barcode (for writing only):

 

Value

Meaning

 

BARCODE_1D_TEXT_BOTTOM

[0x800] Writes the barcode's text at the bottom of the barcode. This option is ignored for the following standard 1D barcode types; BARCODE_1D_EAN_13, BARCODE_1D_EAN_8, BARCODE_1D_UPC_A, BARCODE_1D_UPC_E, BARCODE_1D_EANEXT_5, and BARCODE_1D_EANEXT_2, for these types the text is written according the their ISO standard.

 

BARCODE_1D_TEXT_TOP

[0x800] Writes the barcode's text at the top of the barcode. This option is ignored for the following standard 1D barcode types; BARCODE_1D_EAN_13, BARCODE_1D_EAN_8, BARCODE_1D_UPC_A, BARCODE_1D_UPC_E, BARCODE_1D_EANEXT_5, and BARCODE_1D_EANEXT_2, for these types the text is written according the their ISO standard.

uAdvancedFlags

Flags that indicate linkage bit value for all GS1 Databar (formerly RSS14) barcode types; direction of  GS1 Databar (formerly RSS14) Stacked and Truncated types, number of  GS1 Databar (formerly RSS14) Expanded Stacked rows to write, and Australian post CIF table for read and write. Combine values to specify one flag from each group by using a bitwise OR ( | ). Possible values are:

 

Linkage bit for GS1 Databar (formerly RSS14), Limited, Expanded, Stacked, and Expanded Stacked barcodes (write only):

 

Value

Meaning

 

BARCODE_1D_TYPE_RSS14_LINKAGE

[0x001] Set linkage bit for GS1 Databar (formerly RSS14), Limited, Expanded, Stacked, and Expanded Stacked barcodes. This flag is used within the LBarcode::Write function.

 

GS1 Databar (formerly RSS14) two-row (Stacked) format (write only):

 

Value

Meaning

 

BARCODE_1D_TYPE_RSS14_OMNI

[0x002] Write GS1 Databar (formerly RSS14) two-row in GS1 Databar (formerly RSS14) Stacked Omni-directional format. If not set, GS1 Databar (formerly RSS14) Stacked format will be written. This flag is used within the LBarcode::Write function.

 

GS1 Databar (formerly RSS14) Truncated format (write only):

 

Value

Meaning

 

BARCODE_1D_TYPE_RSS14_TRUNCATED

[0x100] Write GS1 Databar (formerly RSS14) Truncated. If not set, GS1 Databar (formerly RSS14) Standard will be written. This flag is used within the LBarcode::Write function.

 

Determine the number of rows to write for GS1 Databar (formerly RSS14) Expanded Stacked format (write only):

 

Value

Meaning

 

BARCODE_1D_TYPE_RSS14_EXP_1

[0x004] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 1 row.

 

BARCODE_1D_TYPE_RSS14_EXP_2

[0x008] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 2 rows.

 

BARCODE_1D_TYPE_RSS14_EXP_3

[0x00C] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 3 rows.

 

BARCODE_1D_TYPE_RSS14_EXP_4

[0x010] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 4 rows.

 

BARCODE_1D_TYPE_RSS14_EXP_5

[0x014] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 5 rows.

 

BARCODE_1D_TYPE_RSS14_EXP_6

[0x018] Write the GS1 Databar (formerly RSS14)Expanded Stacked barcode into 6 rows.

 

Australian post customer information filed (CIF) encoding/decoding table flags (read/write):

 

Value

Meaning

 

BARCODE_AUS4STATE_CIF_C

[0x000] Use the C table.

 

BARCODE_AUS4STATE_CIF_N

[0x040] Use the N table.

 

BARCODE_AUS4STATE_CIF_S

[0x080] No table is used. The LBarcode::Read function will read the CIF bar states, so that users can use their own table to decode the information. For the LBarcode::Write function, the user must enter the state value for all CIF bars (16 bars for FCC 59 and 31 bars for FCC 62.) State values are either 0 (H), 1 (A), 2 (D), or 3 (T).

Comments

This structure is used with LBarcode::Read and LBarcode::Write functions only for linear barcodes.

pBARCODE1D is a pointer to an BARCODE1D structure. Where the function parameter type is pBARCODE1D, you can declare a BARCODE1D variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pBARCODE1D variable is necessary only if your program requires a pointer.

The Linear barcodes are not supported in UNICODE.

A barcode is composed of start mark, data, and end mark. Reading barcodes from left to right (passing BARCODE_DIR_LEFT_TO_RIGHT value to the nDirection member) or from right to left (passing BARCODE_DIR_RIGHT_TO_LEFT value to the nDirection member) will produce the same result in most cases, because the barcode reader engine recognizes the start and end marks, and handles the data accordingly.

For example, if BARCODE_DIR_LEFT_TO_RIGHT is passed and the user reads barcodes from left to right (the barcode is not rotated), the engine will recognize the start mark first, then the data, and finally the end mark.

But if the user reads barcodes from right to left (the barcode is rotated 180 degrees), the engine will first recognize the end mark, then read the (reverse-order) data, and then recognize the start mark. In this case, the engine will flip the data to normal (start/data/end) order.

Some  GS1 Databar (formerly RSS14) Expanded Stacked strings have a fixed number of symbols. LBarcode::Write returns ERROR_BARCODE_STRING if the number of rows does not fit.

For a table containing information for writing linear 1D barcodes, refer to: http://www.leadtools.com/SDK/Document/Document-Addon-Barcodelinear1D-chart.htm.

NOTE: Type RSS14 has been renamed GS1 Databar. All references to RSS14 now refer to GS1 Databar.