Extract Data from PDF417 of Driver Licenses

scan drivers license barcode

Last Updated on

According to the Card Design Standard by AAMVA, the PDF417 two-dimensional bar code symbology is the minimum mandatory machine-readable technology that must be present on compliant driving license/identification documents. The barcode encodes key information about the cardholder, including name, date of birth, sex, eye color, height, and many others.

There are two ways to extract data from a driver license for a machine:

  • Using OCR technology to recognize the characters printed on an ID
  • Use barcode recognition technology to decode the PDF417 symbology and then parse it into human-readable formats

Generally speaking, the latter is more accurate and cost-effective than the former. In this article, we discuss how to use barcoding technology for text extraction from a driver’s license. 

How to Extract Data from PDF417 of Driver Licenses

Option 1: Decode PDF417 from Cameras in a Web Application

If you are looking to read a driver’s license from a camera source, please refer to the instructions in the article: How to Recognize US Driver’s License in JavaScript.

Download the full sample

View the Full Source Code on Github >

Option 2: Read PDF417 from Scanners in a Web Application

If the driver’s license is copied on paper, you can digitalize it from a document scanner using Dynamic Web TWAIN first.

To see how this works, you can give it a try at the demo here.

free online document scan
Online Demo – Reading PDF417 Barcode on Driver’s License

Please note that this demo also features document scanning, which is powered by Dynamsoft’s Web TWAIN SDK.

Download the full sample

The full sample code is also available on the website. If you have any questions or comments, please feel free to contact us at support@dynamsoft.com.

Option 3: Read Driver’s Licenses in Android and iOS Native Apps

If you are looking to read a driver’s license in a native app, please refer to the instructions in the article: How to Recognize US Driver’s License on Android Mobile Apps.

Parse PDF417 Results into a Human-readable Format

After the PDF417 value is decoded, we can then parse it into separate fields.

driverLicenseFields = [
		{ 'abbreviation': 'DAA', 'description': 'Full Name' }
		, { 'abbreviation': 'DAB', 'description': 'Last Name' }
		, { 'abbreviation': 'DAB', 'description': 'Family Name' }
		, { 'abbreviation': 'DAC', 'description': 'First Name' }
		, { 'abbreviation': 'DAC', 'description': 'Given Name' }
		, { 'abbreviation': 'DAD', 'description': 'Middle Name or Initial' }
		, { 'abbreviation': 'DAD', 'description': 'Middle Name' }
		, { 'abbreviation': 'DAE', 'description': 'Name Suffix' }
		, { 'abbreviation': 'DAF', 'description': 'Name Prefix' }
		, { 'abbreviation': 'DAG', 'description': 'Mailing Street Address1' }
		, { 'abbreviation': 'DAH', 'description': 'Mailing Street Address2' }
		, { 'abbreviation': 'DAI', 'description': 'Mailing City' }
		, { 'abbreviation': 'DAJ', 'description': 'Mailing Jurisdiction Code' }
		, { 'abbreviation': 'DAK', 'description': 'Mailing Postal Code' }
		, { 'abbreviation': 'DAL', 'description': 'Residence Street Address1' }
		, { 'abbreviation': 'DAM', 'description': 'Residence Street Address2' }
		, { 'abbreviation': 'DAN', 'description': 'Residence City' }
		, { 'abbreviation': 'DAO', 'description': 'Residence Jurisdiction Code' }
		, { 'abbreviation': 'DAP', 'description': 'Residence Postal Code' }
		, { 'abbreviation': 'DAQ', 'description': 'License or ID Number' }
		, { 'abbreviation': 'DAR', 'description': 'License Classification Code' }
		, { 'abbreviation': 'DAS', 'description': 'License Restriction Code' }
		, { 'abbreviation': 'DAT', 'description': 'License Endorsements Code' }
		, { 'abbreviation': 'DAU', 'description': 'Height in FT_IN' }
		, { 'abbreviation': 'DAV', 'description': 'Height in CM' }
		, { 'abbreviation': 'DAW', 'description': 'Weight in LBS' }
		, { 'abbreviation': 'DAX', 'description': 'Weight in KG' }
		, { 'abbreviation': 'DAY', 'description': 'Eye Color' }
		, { 'abbreviation': 'DAZ', 'description': 'Hair Color' }
		, { 'abbreviation': 'DBA', 'description': 'License Expiration Date' }
		, { 'abbreviation': 'DBB', 'description': 'Date of Birth' }
		, { 'abbreviation': 'DBC', 'description': 'Sex' }
		, { 'abbreviation': 'DBD', 'description': 'License or ID Document Issue Date' }
		, { 'abbreviation': 'DBE', 'description': 'Issue Timestamp' }
		, { 'abbreviation': 'DBF', 'description': 'Number of Duplicates' }
		, { 'abbreviation': 'DBG', 'description': 'Medical Indicator Codes' }
		, { 'abbreviation': 'DBH', 'description': 'Organ Donor' }
		, { 'abbreviation': 'DBI', 'description': 'Non-Resident Indicator' }
		, { 'abbreviation': 'DBJ', 'description': 'Unique Customer Identifier' }
		, { 'abbreviation': 'DBK', 'description': 'Social Security Number' }
		, { 'abbreviation': 'DBL', 'description': 'Date Of Birth' }
		, { 'abbreviation': 'DBM', 'description': 'Social Security Number' }
		, { 'abbreviation': 'DBN', 'description': 'Full Name' }
		, { 'abbreviation': 'DBO', 'description': 'Last Name' }
		, { 'abbreviation': 'DBO', 'description': 'Family Name' }
		, { 'abbreviation': 'DBP', 'description': 'First Name' }
		, { 'abbreviation': 'DBP', 'description': 'Given Name' }
		, { 'abbreviation': 'DBQ', 'description': 'Middle Name' }
		, { 'abbreviation': 'DBQ', 'description': 'Middle Name or Initial' }
		, { 'abbreviation': 'DBR', 'description': 'Suffix' }
		, { 'abbreviation': 'DBS', 'description': 'Prefix' }
		, { 'abbreviation': 'DCA', 'description': 'Virginia Specific Class' }
		, { 'abbreviation': 'DCB', 'description': 'Virginia Specific Restrictions' }
		, { 'abbreviation': 'DCD', 'description': 'Virginia Specific Endorsements' }
		, { 'abbreviation': 'DCE', 'description': 'Physical Description Weight Range' }
		, { 'abbreviation': 'DCF', 'description': 'Document Discriminator' }
		, { 'abbreviation': 'DCG', 'description': 'Country territory of issuance' }
		, { 'abbreviation': 'DCH', 'description': 'Federal Commercial Vehicle Codes' }
		, { 'abbreviation': 'DCI', 'description': 'Place of birth' }
		, { 'abbreviation': 'DCJ', 'description': 'Audit information' }
		, { 'abbreviation': 'DCK', 'description': 'Inventory Control Number' }
		, { 'abbreviation': 'DCL', 'description': 'Race Ethnicity' }
		, { 'abbreviation': 'DCM', 'description': 'Standard vehicle classification' }
		, { 'abbreviation': 'DCN', 'description': 'Standard endorsement code' }
		, { 'abbreviation': 'DCO', 'description': 'Standard restriction code' }
		, { 'abbreviation': 'DCP', 'description': 'Jurisdiction specific vehicle classification description' }
		, { 'abbreviation': 'DCQ', 'description': 'Jurisdiction-specific' }
		, { 'abbreviation': 'DCR', 'description': 'Jurisdiction specific restriction code description' }
		, { 'abbreviation': 'DCS', 'description': 'Family Name' }
		, { 'abbreviation': 'DCS', 'description': 'Last Name' }
		, { 'abbreviation': 'DCT', 'description': 'Given Name' }
		, { 'abbreviation': 'DCT', 'description': 'First Name' }
		, { 'abbreviation': 'DCU', 'description': 'Suffix' }
		, { 'abbreviation': 'DDA', 'description': 'Compliance Type' }
		, { 'abbreviation': 'DDB', 'description': 'Card Revision Date' }
		, { 'abbreviation': 'DDC', 'description': 'HazMat Endorsement Expiry Date' }
		, { 'abbreviation': 'DDD', 'description': 'Limited Duration Document Indicator' }
		, { 'abbreviation': 'DDE', 'description': 'Family Name Truncation' }
		, { 'abbreviation': 'DDF', 'description': 'First Names Truncation' }
		, { 'abbreviation': 'DDG', 'description': 'Middle Names Truncation' }
		, { 'abbreviation': 'DDH', 'description': 'Under 18 Until' }
		, { 'abbreviation': 'DDI', 'description': 'Under 19 Until' }
		, { 'abbreviation': 'DDJ', 'description': 'Under 21 Until' }
		, { 'abbreviation': 'DDK', 'description': 'Organ Donor Indicator' }
		, { 'abbreviation': 'DDL', 'description': 'Veteran Indicator' }
		, { 'abbreviation': 'PAA', 'description': 'Permit Classification Code' }
		, { 'abbreviation': 'PAB', 'description': 'Permit Expiration Date' }
		, { 'abbreviation': 'PAC', 'description': 'Permit Identifier' }
		, { 'abbreviation': 'PAD', 'description': 'Permit IssueDate' }
		, { 'abbreviation': 'PAE', 'description': 'Permit Restriction Code' }
		, { 'abbreviation': 'PAF', 'description': 'Permit Endorsement Code' }
		, { 'abbreviation': 'ZVA', 'description': 'Court Restriction Code' }
	]

Try Dynamsoft Barcode Reader

If you’re at the stage where you’re testing different options, try Dynamsoft Barcode Reader online demo or download a 30-day free trial. There’s no commitment necessary.

Dynamsoft was founded in 2003 in Vancouver, Canada. Since then, we have earned the trust of many Fortune 500 companies, including Lockheed Martin, HP, IBM, Intel, Disney, the US Government, NASA, Siemens, and many more.

Mvi case study graphic

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.

Subscribename@email.com