Skip to content

Commit 558ebd5

Browse files
author
coheedandcambria
committed
Finalized the last readme of the set.
1 parent d802d18 commit 558ebd5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

4.use-case/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Use Case Sample Set
2+
3+
This sample set explores some of the most popular real world applications of the `DBR` library that our team has encountered throughout our many years of experience.
4+
5+
### Filling a Form Field with the Barcode Scanner
6+
The first sample will demonstrate how to implement one of, if not the most common usage scenario our library encounters: Filling a form or form field based on the barcode result.
7+
8+
Usually this scenario involves oopening the video scanner on the click of a button, and then once the barcode is scanned, the barcode result would show up in a corresponding form field. In some cases, the form field would come with a tooltip style of button to allow the user to open the scanner on the click of that icon.
9+
10+
This is done in the `onUnduplicatedRead` method of the `scanner` object, so that it is almost instantaneous with finding the barcode.
11+
12+
### Filling out Driver's License Info via the Barcode Scanner
13+
Another very popular scenario is extracting the driver license info that is encoded on the back of driver licenses into a readable text. The text that is normally encoded in the barcode comes as one large string, separated by abbreviations only. The string will in turn require parsing and mapping to have all the info in its corresponding fields.
14+
15+
In order to ensure that the scanner picks up only PDF417 barcode types, we first ensure that the `barcodeFormatIds` of the `RuntimeSettings` is set to `BF_PDF417`. This way, the scanner is better configured to pick up the driver license barcodes.
16+
17+
The core text extraction happens in the function `extractInformation`. Please pay special attention to the `driverLicenseFields` variable, which contains all the mapping defintions for the different abbreviations.
18+
19+
By following a similar extraction and mapping mechanism, you can easily implement this feature in your own web application.

0 commit comments

Comments
 (0)