VALIDPDF417

Conformance guide · ISO/IEC 15438 · AAMVA DL/ID

What a valid PDF417 barcode is, and what it is not.

A valid PDF417 symbol and a valid AAMVA credential are two separate tests. A symbol can pass the first and fail the second, and almost every "it will not scan" report lives in that gap.

Encoded to AAMVA DL/ID Card Design Standard 2020, version 10 — not the 2025 (v11) revision.

Updated 2026-11-10 · 1,700 words · applies to every jurisdiction in the API

What the encoder derives

Six things the encoder builds instead of copying.

Header maths from the standard

IIN, version, entry count, designator, offset and length are derived per jurisdiction, not copied from a sample.

Fifty states and DC

Every issuer number in one table, with the class, restriction and endorsement elements each one expects.

Vector or raster

SVG for offset and laser, PNG at any DPI from 72 to 1200 for thermal and card printers.

Truncation, declared

DDE, DDF and DDG are set when a name is cut, so a reader never reports a complete name that is not on the card.

Compliance flag

DDA is F or N as you supply it. REAL ID and older cards both encode without special cases.

Payload on screen

The exact byte string is shown before you download it. Nothing sits between the form and the symbol.

Part one: what makes a PDF417 symbol valid

ISO/IEC 15438 defines the symbol, and it defines more than bars. There is a start pattern, a stop pattern, a row structure and a block of error correction codewords. Software that only draws bars can produce an image that looks plausible and decodes nowhere.

Start and stop patterns

Each row opens with the same 17-module start pattern and closes with the same 18-module stop pattern. The start pattern is what a scanner locks onto and how it derives module width; the stop pattern confirms the row ended where the encoder said it would. Crop the right edge or clip the quiet zone and the stop pattern is gone. No error correction level recovers a missing stop pattern, because the failure is physical rather than numeric.

Row indicators and row structure

A row indicator codeword sits at each end of every row. Between them they carry the row number, the row count, the column count and the error correction level. That is how a reader knows it has seen the whole symbol after starting in the middle. If the indicators disagree with the rows actually printed, the symbol is malformed even when every data codeword is intact.

Data codewords and the compaction modes

Data is packed into codewords in text, byte and numeric modes. An AAMVA payload is mostly upper-case text plus digits and control characters, so a conforming encoder switches mode as it walks the string. The latch codewords are part of the stream and consume capacity. At the margin this decides whether a payload fits the chosen row limit or spills past it.

Error correction codewords

Level n appends 2(n+1) Reed–Solomon codewords: two at level 0, sixty-four at level 5, five hundred and twelve at level 8. The level is recorded in the row indicators and in the codeword stream, so a reader can check it. A truncated error correction block fails to decode even when the data survived.

LevelCodewordsApproximate recoveryTypical use
02~0%Clean laser output
28~7%Thermal paper
432~15%Unlaminated card
564~20%Card stock
6128~25%Laminated card
8512~35%Wide labels, high wear

A higher level does not make a symbol more valid. It makes it more tolerant of damage and taller. The error correction reference has the decision table by substrate.

ISO/IEC 15438 conformance

Conformance means the symbol decodes to the exact bytes that went in, at the declared error correction level and dimensions. The practical test fits in one line: decode the output, compare the bytes. If the decoded string differs from the input, the symbol is not conforming, however good it looks.

Part two: what makes an AAMVA symbol valid

An AAMVA DL/ID symbol is a PDF417 symbol whose payload follows the AAMVA DL/ID Card Design Standard. ISO/IEC 15438 gets you a readable symbol; AAMVA gets you a credential a reader will accept.

The header

The first 31 bytes have a fixed shape. Byte 0 is the compliance indicator @. Bytes 1 to 3 are the data element separator, record separator and segment terminator: 0x0A, 0x1E, 0x0D. Bytes 4 to 8 are the file type marker ANSI , trailing space included. Bytes 9 to 14 are the six-digit IIN. Bytes 15 to 16 hold the AAMVA version, 17 to 18 the jurisdiction version, 19 to 20 the entry count. The subfile designator follows with its offset and length.

A header of 30 or 32 bytes is not repairable at the field level. Every offset after it is wrong by the difference.

The issuer identification number

The IIN names the issuing jurisdiction. It is six assigned digits and cannot be derived from the state code. California is 636014, New York is 636001, the District of Columbia is 636043. The jurisdiction index lists all 51.

A symbol whose header IIN disagrees with its DAJ element is internally inconsistent. Some readers trust the header and some trust DAJ, so the same card reads as two different issuers. Both values can be individually valid and the symbol is still wrong.

Subfile designator, offset and length

The designator is two characters, DL for a driver's licence subfile. The offset is a four-digit decimal byte position measured from the start of the file. The length is a four-digit decimal count of the subfile's two-byte designator, its elements and the closing 0x0D. Neither number is repeated inside the subfile.

arithmetic
header bytes          31
subfile designator     2   (DL, written once at the offset)
body bytes           278   (elements, each ending 0x0A, then 0x0D)
subfile length       280   (2 + 278)
file length          311   (31 + 280)

The common mistake is copying the directory entry into the subfile. It survives a visual check, the duplicate parses as a DL0 element, and a reader that bounds the record by the length field reads ten bytes too far. The byte-level reference walks the same arithmetic through a real payload with every byte labelled.

Truncation flags

DDE, DDF and DDG track the family, given and middle names. The value is T when the card holds more characters than the symbol stores, and N when it does not. Truncation without the flag is silent data loss: the reader reports a full name that is not the name on the card.

The compliance flag

DDA is F for a REAL ID compliant card and N otherwise. It mirrors the card's status. It is not computed from the expiry date or from whether an address is present, and a wrong value changes how a reader treats the credential.

Part three: six reasons a symbol fails to scan

  1. The subfile length is wrong. Usually ten bytes long, because the directory entry was repeated inside the subfile. The symbol decodes and the first element reads as DL0.
  2. The offset points at the wrong byte. Often lifted from a two-subfile sample. The reader finds something other than DL and stops.
  3. The IIN belongs to another jurisdiction. A sample payload was reused. The structure is perfect and the issuer is wrong.
  4. Error correction is too low for the stock. Level 2 on laminated card, or level 0 from a thermal head. The first dropout exceeds the recovery budget.
  5. The image was resampled. A 600 DPI PNG scaled to fit a label changes module width unevenly, and the scanner cannot establish a consistent grid.
  6. The print lost the quiet zone or the stop pattern. The template crops the right edge, or the barcode sits too close to a card edge. No EC level repairs a missing stop pattern.

Five of the six are data or print defects, not encoder defects. That is why "which generator" is the wrong first question when a symbol fails.

Part four: how to verify one

Decode the raw bytes, not a formatted summary. Check the header byte by byte, recompute the offset and length, then walk the elements. A checker that does exactly this in the browser is at /check-a-pdf417-barcode/: byte table, IIN lookup, arithmetic, and a pass or fail per rule.

Then print one at production size on production stock and scan it with the reader that will be at the counter. A file that decodes is necessary and not sufficient.

Part five: conformance checklist

CheckPass condition
Symbol decodesRaw bytes match the encoded payload
Compliance indicatorByte 0 is 0x40
SeparatorsBytes 1–3 are 0A 1E 0D
File typeBytes 4–8 are ANSI
IINSix digits, matches DAJ
VersionsAAMVA 10, jurisdiction 00
Entry countMatches the number of subfiles present
OffsetPoints at the subfile designator
LengthEquals the designator, the elements and the closing 0x0D
Required elementsAll present for the jurisdiction
Truncation flagsMatch the actual name lengths
EC levelMatches the substrate
Print600 DPI, unscaled, full quiet zone

Related

The byte-level reference is AAMVA payload structure; the substrate rules are in error correction. For how this API differs from a pay-per-barcode web form, read pdf417.pro vs VALIDPDF417.

Generate barcode now