Lowest Level Structure of PDF417

Codeword Structure

A codeword is the unit for encoding a value representing, or associated with, numbers, letters, or symbols. There are 929 codeword values defined in PDF417. These values are 0 - 928.

There are four bars and four spaces in each codeword. Individual bars or spaces can vary in width from one to six modules, but the combined total per codeword is always 17 modules. The width of one module, or narrowest element width, is the x-dimension of that symbol. Its height is the y-dimension.

Each codeword is defined by an 8 digit sequence, which represents the 4 sets of alternating bar and space widths within that codeword. This is called the x-sequence.  For instance, in an x-sequence of 31111334, the first element is a bar three modules wide, followed by five elements one module wide each, one element three modules wide, and the last element six modules wide.

Focusing on element widths along the x-sequence (x0 ... x7), we might diagram another PDF417 codeword like this:

Start and Stop Pattern Structure

Start and stop patterns announce where the symbol begins and ends.  By doing this, they make reading the bar code possible whether the scan is left-to-right or right-to-left.

For these purposes, PDF417 uses unique start and stop patterns. The start pattern, or left end of the symbol, has the unique pattern, or x-sequence, of 81111113. The stop pattern, or right end of the symbol, has the unique x-sequence of 711311121. No character pattern other than start/stop uses more than six modules per element. For space termination, the stop pattern contains one extra bar (or ninth element), of width one, at the end.

Row Structure

Each row consists of a start pattern, a left row indicator codeword, data codewords, a right row indicator codeword, and a stop pattern. Note that codewords are numbered from right to left.

Row indicators, discussed later, help synchronize the symbol's structure. They help define which row a particular one is, which is the left and right side of that row, how many rows are in the symbol, what security level is encoded in the symbol, and how many data columns are in the rows.

Overall Symbol Structure

Any PDF417 symbol is made up of at least 3 rows, and at most 90 rows. The minimum number of codewords in a row is 3; this includes the left row indicator codeword, 1 data codeword, and the right row indicator.

Every symbol contains 1 codeword (the first data codeword in row 0) indicating the total number of data codewords within the symbol, and at least 2 error-detection codewords.