3 The Flags

The following flags are supported by version 0.98 of the library:

BARCODE_ENCODING_MASK

The mask is used to extract the encoding-type identifier from the flags field.

BARCODE_EAN
BARCODE_UPC
BARCODE_ISBN
BARCODE_128B
BARCODE_128C
BARCODE_128
BARCODE_128RAW
BARCODE_39
BARCODE_I25
BARCODE_CBR
BARCODE_MSI
BARCODE_PLS
BARCODE_93

The currently supported encoding types: EAN (13 digits, 8 digits, 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2 or 5 digit add-on), ISBN (with or without the 5-digit add-on), CODE128-B (the whole set of printable ASCII characters), CODE128-C (two digits encoded by each barcode symbol), CODE128 (all ASCII values), a “raw-input” pseudo-code that generates CODE128 output, CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar (numeric plus a few symbols), MSI (numeric) and Plessey (hex digits). See Supported Encodings.

BARCODE_ANY

This special encoding type (represented by a value of zero, so it will be the default) tells the encoding procedure to look for the first encoding type that can deal with a textual string. Therefore, a 11-digit code will be printed as UPC (as well as 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5) as EAN13, an ISBN code (with or without hyphens, with or without add-5) will be encoded in its EAN13 representation, an even number of digits is encoded using CODE128C and a generic string is encoded using CODE128B. Since code-39 offers a much larger representation for the same text string, code128-b is preferred over code39 for alphanumeric strings.

BARCODE_NO_ASCII

Instructs the engine not to print the ascii string on output. By default the bar code is accompanied with an ascii version of the text it encodes.

BARCODE_NO_CHECKSUM

Instructs the engine not to add the checksum character to the output. Not all the encoding types can drop the checksum; those where the checksum is mandatory (like EAN and UPC) just ignore the flag.

BARCODE_OUTPUT_MASK

The mask is used to extract the output-type identifier from the flags field.

BARCODE_OUT_PS
BARCODE_OUT_EPS
BARCODE_OUT_PCL
BARCODE_OUT_PCL_III

The currently supported encoding types: full-page postscript and encapsulated postscript; PCL (print command language, for HP printers) and PCL-III (same as PCL, but uses a font not available on older printers).

BARCODE_OUT_NOHEADERS

The flag instructs the printing engine not to print the header and footer part of the file. This makes sense for the postscript engine but might not make sense for other engines; such other engines will silently ignore the flag just like the PCL back-end does.