Reading and Writing AAMVA Barcodes on Driver’s Licenses

One highly practical new feature in LEADTOOLS Version 20 is the parsing of AAMVA barcodes. If you’re not familiar, the American Association of Motor Vehicle Administrators (AAMVA) created a standard for those barcodes on the back of your driver’s license. It contains all the information on the front and provides reliable, fast, and accurate reading of that information by parsing the barcode.

Why LEADTOOLS?

Technically, we’ve been able to read these barcodes for quite a while because it’s simply a PDF417 barcode. However, standards adoption is a slow process but is finally widespread throughout North America. What makes LEADTOOLS special compared to the many other barcode engines out there is that one of our poor developers spent weeks reading the AAMVA specs for you (he’s a pretty nice guy for a Patriots fan), and now we have a high-level .NET class that encapsulates the whole spec.

That means that you can turn this gibberish (the raw data of the barcode):


@
ANSI 636004080002DL00410266ZN03070017DLDAQ123456789123
DCSDOE
DDEN
DACJANE
DDFN
DAD
DDGN
DCAC
DCBNONE
DCDNONE
DBD08152015
DBB08151987
DBA08152020
DBC2
DAU070 in
DAYBRO
DAG1100 NEW BERN AVENUE
DAIRALEIGH
DAJNC
DAK276970001
DCF0123456789
DCGUSA
DAZBRO
DCLU  
DCK000012345678NCSVTL01
DDB10242014
DDK1
DDL1
ZNZNADUP
ZNB
ZNC0

into this lovely AAMVAID class with strongly typed properties for all those fields!


using (AAMVAID id = BarcodeData.ParseAAMVAData(data.GetData(), false))
{
   Console.WriteLine("Issuer Identification Number: " + id.IssuerIdentificationNumber);
   Console.WriteLine("First Name: " + id.FirstName.Value);
   Console.WriteLine("Last Name: " + is.LastName.Value);
   Console.WriteLine("Over 21?: " + id.Over21);
   // etc.
}

Writing AAMVA barcodes that conform to the 2016 AAMVA CDS is similarly easy in LEADTOOLS. The AAMVAIDBuilder object will collect and organize the customer information and then output the AAMVA string for use in our BarcodeEngine class.

Full Example on Code Project

Enough blabbering on, you’re a developer after all and probably communicate better with code. For more details and a full example of how to read and write AAMVA barcodes from driver’s licenses, see our recent article on Code Project.

Change the World! (or at least your DMV…)

Reading is actually the easy part. Most of you on this blog are pretty keen and might’ve picked up on how the raw data in that string worked and thought, “I could parse that!” As mentioned previously, the biggest catch out there is adoption. It’s one thing to figure out how to parse some values from a long text string, but writing them out correctly and following the AAMVA spec is what’s really holding states and countries back. LEADTOOLS makes it incredibly easy to make sure your data follows the specifications, AND can write the barcode. So get out there and code something that’s so easy, even a sloth can do it!

About 

Developer Advocate

This entry was posted in Barcode and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *