VALIDPDF417

Parameters

Every element the encoder accepts, its cap, and its pattern.

Element identifiers

Values are uppercased before encoding. Lowercase input is accepted and normalised.

IDLabelMaxPattern
DAQLicense number25[A-Z0-9-]
DCSFamily name40[A-Z0-9 '-]
DACGiven name40[A-Z0-9 '-]
DADMiddle name40[A-Z0-9 '-]
DBBDate of birth8CCYYMMDD in, MMDDYYYY wire
DBAExpiry8CCYYMMDD in, MMDDYYYY wire
DBDIssue date8CCYYMMDD in, MMDDYYYY wire
DBCSex11 · 2 · 9
DAGStreet40[A-Z0-9 '.#-]
DAHCounty / line 225[A-Z '.-]
DAICity25[A-Z '.-]
DAKPostal code95 or 9 digits, space-filled to 11
DAUHeight10NNN IN · NNN CM
DAWWeight6NNN LB · NNN KG
DAYEyes3enumerated
DAZHair3enumerated
DCFDiscriminator25[A-Z0-9-]
DCKInventory25[A-Z0-9-]
DCAVehicle class4[A-Z0-9]
DCBRestrictions12[A-Z0-9 ]
DCDEndorsements12[A-Z0-9 ]
DCGCountry3[A-Z]{3}
DCIPlace of birth25[A-Z '.-]
DCLRace3[A-Z]

Derived elements

DAJ is written from state and cannot be set directly. DDE, DDF and DDG are truncation flags emitted automatically when a name exceeds its cap.

Generated elements

DCF and DCK can be derived from the payload instead of copied from the card. Send a generate object next to fields:

{
  "state": "CA",
  "generate": {"dd": true, "icn": true},
  "fields": {"DAQ": "A1234567", "DCS": "SAMPLE", "DBB": "19900314"}
}
FlagElementOutput
ddDCF12 characters from A-Z 2-9, excluding I, O, 0 and 1
icnDCK12 digits

The 12-character shape applies to generated values only. A DCF supplied in fields is written as provided, inside the element cap and pattern, because real cards carry jurisdiction-specific shapes. Generation never rewrites an explicit value.

Both are derived from DAQ + DBB + DCS, so the same three values always produce the same DCF and DCK across requests and retries. An explicit DCF or DCK in fields always wins and is never overwritten. Omitting generate leaves both out of the subfile unless you supplied them.

Generated values are stable and repeatable, which makes them suitable for fixtures and test pipelines. They are not a substitute for the identifier printed on a real card.

Defaults for omitted required elements

Six elements in the v10 required set are often absent from older integrations. When a field is missing or blank the encoder writes the value below. A supplied value always wins, including 0 for DDK or DDL.

ElementDefault
DBD issue datetoday, written in the version's wire order
DAY eyesBRO
DAU height069 IN
DCG countryUSA
DDK organ donor0
DDL veteran0

These are placeholders, not facts about a cardholder. A production request should send the values printed on the credential.

Validation order

The encoder validates the jurisdiction first, then the required set, then every supplied value: length, pattern, enumeration and date. A missing required element and an unknown element are reported in the same pass, so a form can highlight all of them at once. Values that are not in the allowed set for the jurisdiction are ignored rather than encoded, which prevents an optional field from another state leaking into the subfile.

Patterns are anchored

Every pattern is a full match, not a search. ^[A-Z0-9-]+$ means the whole value is letters, digits and hyphen with no spaces, no slashes and no trailing full stop. A value that fails a pattern is rejected rather than cleaned up, because silently rewriting a name or an address changes the credential.

Dates

Send CCYYMMDD, as in 19900314, or the wire order. Eight digits beginning 19 or 20 are read as CCYYMMDD; any other eight digits are read as MMDDYYYY. A correct date is never rejected for being in the other order. Dates are validated against the real calendar: 19900231 is rejected and 19900228 is accepted, with leap years handled. The wire order is not the input order. AAMVA v01 writes CCYYMMDD; v02 and later, including the v10 this encoder targets, write MMDDYYYY, so 19900314 is emitted as 03141990. The version on the request drives the conversion, not a single global rule.

DAK is fixed-width on the wire. The encoder space-fills it to 11 characters on v10 and earlier, which is the CDS 2020 representation. Under CDS 2025 (v11) it narrows to nine and zero-fills the unknown trailing digits. A value already at or over the width is written unchanged: the encoder never truncates a postal code.

Truncation Names over 40 characters are cut and the matching flag is set to T. The flag is the only signal a reader gets that the card name is longer than the symbol name.
Generate barcode now