Code 128 Barcode
This Symbology is also known as ANSI/AIM
128, ANSI/AIM Code 128, USS Code 128, Uniform Symbology Specification Code 128,
Code 128 Code Set A, Code 128 Code Set B, Code 128 Code Set C, Code 128A, Code
128B, Code 128C
Overview
Code 128 is a linear bar code
symbology capable of encoding the full 128-character ASCII character set and
extended character sets. This Symbology includes a checksum digit for
verification, and the barcode may also be verified character-by-character
verifying the parity of each data byte. It has been widely implemented in many
applications where a relatively large amount of data must be encoded in a
relatively small amount of space.
Code 128 Code Sets
-
Code Set A (or Chars Set A) includes all of the standard upper case U.S.
alphanumeric keyboard characters and punctuation characters together with the
control characters, (i.e. characters with ASCII values from 0 to 95 inclusive),
and seven special characters.
-
Code Set B (or Chars Set B) includes all of the standard upper case
alphanumeric keyboard characters and punctuation characters together with the
lower case alphabetic characters (i.e. characters with ASCII values from 32 to
127 inclusive), and seven special characters.
-
Code Set C (or Chars Set C) includes the set of 100 digit pairs from 00
to 99 inclusive, as well as three special characters. This allows numeric data
to be encoded as two data digits per symbol character, at effectively twice the
density of standard data.
Code 128 Special characters
The last seven characters of Code Sets A and B (character
values 96 - 102) and the last three characters of Code Set C (character values
100 - 102) are special non-data characters with no ASCII character equivalents,
which have particular significance to the bar code reading device.
Sample of a Code 128 Barcode
Sample of a Code 128 Barcode with Bearer Bars
How to create Code 128 barcodes using Barcode
Professional
Note: Please refer to the Class
Reference documentation for more information about the properties and methods
stated in this document.
In order to get a Code 128 barcode image, please follow these
steps:
-
Set the Symbology property to Code128
-
Set the Code128CharSet property to one of the following values depending
on your needs:
-
Auto: Barcode Professional will automatically switch between code sets
to encode the ASCII values.
-
A: Barcode Professional will use the Char Set A which only
supports ASCII values from 0 to 95
-
B: Barcode Professional will use the Char Set B which only
supports ASCII values from 32 to 127
-
C: Barcode Professional will use the Char Set C which only
supports pairs of digits
-
Barcode Professional allows explicit switching between Code 128 Char Sets.
Read more about how it works.
-
Setting up dimensions and quiet zones:
-
Set the BarWidth and BarHeight properties (Values are expressed
in Inches)
-
Set the QuietZoneWidth property (Value is expressed in Inches)
-
Set the TopMargin and BottomMargin properties (Values are
expressed in Inches)
-
Set the Code property with the value to encode.
-
Setting up the Bearer Bars if needed:
-
Set the BearerBarStyle property to Frame, or HorizontalRules
-
Set the BearerBarWidth property (Value is expressed in Inches)
-
Barcode Professional will automatically generate and append the checksum value.
-
Note: In this Symbology the checksum won't appear in the human readable
text.
-
Tip: You can disable this behavior by setting up to False the AddChecksum
property.
Example of a Code 128 barcode images
Code property = ABCD 12345 abcd and Code128CharSet
property = Auto will produce the following barcode image:
Code property = ABCD 12345 abcd and Code128CharSet
property = Auto and BearerBarStyle property = Frame and HorizontalRules
will produce the following barcode images:
Code property = ABCD 12345 and Code128CharSet
property = A will produce the following barcode image:
Code property = 12345 abcd and Code128CharSet
property = B will produce the following barcode image:
Code property = 001122334455 abcd and Code128CharSet
property = C will produce the following barcode image:
Explicit switching between Code 128 Char Sets
You can handle how the data must be encoded specifying some
special chars that represent each Code 128 Char Set. The special chars that
tell to Barcode Professional what Code Set must be used to encode the data that
follows it are these:
-
É (Alt+0201) which indicates that the Char Set to use must be A
-
Ê (Alt+0202) which indicates that the Char Set to use must be B
-
Ë (Alt+0203) which indicates that the Char Set to use must be C
Important Note: When you specify that the
data must be encoded using Char Set C, then the number of chars after it must
be even!
Example of explicit switching between Code 128 Code Sets
Suppose you need to encode 3 alpha chars using Char Set A and
10 numeric digits using Char Set C. You can get it by setting up the following
properties:
-
Set the Symbology property to Code128
-
Set the Code128CharSet property to Auto
-
Set the Code property to ÉABCË1234567890 (Notice the É (Alt+0201)
char indicating that the data that follows it must be encoded using Char Set A,
and the Ë (Alt+0203) char indicating that the data that follows it must be
encoded using Char Set C)