You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UPC and EAN are barcode formats commonly used for product identification. Both UPC and EAN codes can have supplemental 2-digit or 5-digit barcodes, typically found on the right side of the main code.
14
+
UPC and EAN are barcode formats commonly used for product identification. These formats can include supplemental 2-digit or 5-digit barcodes (known as AddOn Codes), typically found on the right side of the main barcode. These AddOn Codes are often used for magazines, books, or other products to encode additional information like pricing or issue numbers.
15
15
16
-
Dynamsoft Barcode Reader (DBR) does not enable reading such AddOn Codes with its default templates.
16
+
Dynamsoft Barcode Reader (DBR) does not enable reading such AddOn Codes by default.
17
17
18
18

19
19

20
20
21
-
In order to read these types of barcodes, the property `EnableAddOnCode` in `BarcodeFormatSpecificationOptions`arrays must be set to `1`.
21
+
To enable AddOn Code scanning, the property `EnableAddOnCode` in the `BarcodeFormatSpecificationOptions`array must be set to 1.
22
22
23
-
### Using JSON Templates
23
+
If you want to limit the Dynamsoft Barcode Reader to only decode UPC and EAN codes with AddOn Codes, consider the following additional configurations:
24
+
1.**Regular Expression Filtering:** Use `BarcodeTextRegExPattern` to exclude results without AddOn Codes.
25
+
2.**Barcode Format Restriction:** Restrict the barcode formats to EAN and UPC only by setting `BarcodeFormatIds`.
24
26
25
-
You can find all occurrences of `EnableAddOnCode` in your existing template file and set their values to `1` instead of the default `0`.
27
+
### Using JSON Templates
26
28
29
+
Modify all of the `EnableAddOnCode` property in your template file by setting its value to `1`:
27
30
```json
28
31
{
29
-
"BarcodeFormatSpecificationOptions": [
32
+
"BarcodeFormatSpecificationOptions":
33
+
[
30
34
{
31
-
"EnableAddOnCode": 1, // 1 to Enable AddOn Codes
35
+
"EnableAddOnCode": 1, // Enable AddOn Codes
32
36
"Name": "bfs1",
37
+
// (OPTIONAL) Apply Regular Expression Filtering
38
+
// Exclude All Other Results Without Addon Codes
39
+
"BarcodeTextRegExPattern" : "\\d+-\\d+",
33
40
...
34
41
},
35
42
...
43
+
],
44
+
"BarcodeReaderTaskSettingOptions" :
45
+
[
46
+
{ // (OPTIONAL) Restrict Formats to EAN and UPC Only
awaitcvRouter.initSettings(settings); // Apply the modified settings
50
79
```
51
80
81
+
### Sample Code
82
+
83
+
You may also find it helpful to explore our [blog post on scanning EAN/UPC and AddOn codes with JavaScript](https://www.dynamsoft.com/codepool/scan-ean-upc-and-its-add-on-javascript.html).
0 commit comments