02-06-2020 17:41 PM - last edited 02-07-2020 09:03 AM
This app shows you how to extract data from a drivers license barcode. There is an incredible amount of data in every drivers license; being able to collect it has many purposes. From HR on-boarding to event registration and check in, the possibilities are nearly endless.
There isn't a lot to this app. Each value has it's own Match() function to build the data collection. In the example below you can see that the abbreviation "DAA" matches the "Full Name" value, so I use a regular expression to find that value and add it to the collection.
{Value: First(Match(LicenseData,"\n" & "DAA" & "(.+)\n",MatchOptions.Contains).SubMatches), Description: "Full Name" },
Special thanks to this post that had the abbreviations for all the data explained.
https://blog.dynamsoft.com/imaging/extract-data-pdf417-driver-licenses/
Download the app, scan your license (or the sample license barcode attached) and let me know some use cases you can think of!
Thank you!
Eric
I think it depends on what state you are decoding for but have you checked to see if the data you need is in one of the two following outputs:
First(
Match(
LicenseData,
"\n" & "DAQ" & "(.+)\n",
MatchOptions.Contains
).SubMatches).Value
or
First(
Match(
LicenseData,
"\n" & "DCF" & "(.+)\n",
MatchOptions.Contains
).SubMatches
).Value
I don't really understand all of the regular expression stuff but I tried on the test barcode from this post and my state's barcode which uses the same format as the test. They both have the DAQ prefix preceding the license number. Unlike all of the other ones where the new line starts with the prefix, the DAQ one is in the middle of the string of that line, not starting as its own line. As an example, the sample barcode from this post has DAQ is in the line "ANSI 6360050101DL00300203DLDAQ3265188" and the match isn't finding the DAQ in that line and returning 3265188. It works for every other field!
I can also recommend checking this article of a Barcode SDK provider, giving an overview of the barcode types.