Skip to content

Commit 12a7bf2

Browse files
Merge branch 'main' into preview
2 parents bca5aa3 + 0e17f90 commit 12a7bf2

File tree

10 files changed

+137
-19
lines changed

10 files changed

+137
-19
lines changed

_includes/sidelist-faq.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<li>
2-
<a href="{{ site.faq_general }}index.html" class="otherLinkColour">FAQ</a>
2+
<a class="otherLinkColour">FAQ</a>
33
<ul>
44

55
<li>
66
<a href="{{ site.faq_general }}general.html">General</a>
77
</li>
88
<li>
9-
<a href="{{ site.faq_general }}license-usage.html">Licensing & Usage</a>
9+
<a href="{{ site.faq_general }}license-usage.html">Dynamsoft Licensing & Usage</a>
1010
</li>
1111
<li>
12-
<a href="{{ site.faq_general }}configuration.html">Configuration</a>
12+
<a href="{{ site.faq_general }}configuration.html">Dynamsoft Barcode Reader Configuration</a>
1313

1414
</li>
1515
<li>
16-
<a href="{{ site.faq_general }}multi-platform.html">Multi Platform</a>
16+
<a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/faq/">Dynamsoft Barcode Reader for JS</a>
1717
</li>
1818

1919
<li>
20-
<a href="{{ site.faq_general }}error-debug.html">Error & Debug</a>
20+
<a href="https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/objectivec-swift/faq/">Dynamsoft Barcode Reader for iOS</a>
21+
</li>
22+
<li>
23+
<a href="https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/faq/">Dynamsoft Barcode Reader for Android</a>
24+
</li>
25+
<li>
26+
<a href="https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/maui/faq/">Dynamsoft Barcode Reader for MAUI</a>
2127
</li>
2228
</ul>
2329
</li>

faq/general/configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ permalink: /faq/general/configuration.html
1717

1818
3. [How to filter incorrect results with the barcode result length?](avoid-incorrect-results.html)
1919

20-
4. [What will happen if licenses are not renewed in time?](what-happens-if-license-expires.html)
20+
4. [How to Handle Non-printable Characters Like "\u{1D}" or "{GS}" from the Barcode Text?](unprintable-character.html)
2121

22-
5. [How to Handle Non-printable Characters Like "\u{1D}" or "{GS}" from the Barcode Text?](unprintable-character.html)
22+
5. [How to create custom settings template?](custom-settings-template.html)
2323

24-
6. [How to create custom settings template?](custom-settings-template.html)
24+
6. [How can I sort the barcodes of my image in reading order?](sort-barcodes-image.html)
2525

26-
7. [How can I sort the barcodes of my image in reading order?](sort-barcodes-image.html)
26+
7. [How to Scan EAN/UPC with Addon Codes?](how-to-scan-ean-upc-with-addon.md)

faq/general/custom-settings-template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permalink: /faq/general/custom-settings-template.html
1111

1212
One of the strengths of the Dynamsoft Barcode Reader is its wide range of cuztomizable options that can optimize the performance of the SDK. Whether you are looking to prioritize read rate or speed, these settings can be used in many ways to match the targeted use case.
1313

14-
If you are looking to create your own custom template of settings to use with the [InitSettingsFromFile][https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/settings.html?product=dbr&repoType=server#initsettingsfromfile] methods, here are the steps:
14+
If you are looking to create your own custom template of settings to use with the [InitSettingsFromFile](https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/settings.html?product=dbr&repoType=server#initsettingsfromfile) method, here are the steps:
1515

1616
1. Visit the main [online demo](https://demo.dynamsoft.com/barcode-reader/).
1717

@@ -23,6 +23,6 @@ If you are looking to create your own custom template of settings to use with th
2323

2424
5. Copy the JSON code under *Template* and paste it into your own JSON file, or you can download the template JSON file straight from the demo.
2525

26-
6. The template you downloaded is currently Barcode Reader version 9 template and the latest version is version 10. Use the [TemplateConverter Tool](https://download2.dynamsoft.com/dcv/TemplateConverter.zip) to convert the template to Barcode Reader version 10 compatible template.
26+
Note: If you have a JSON file that you previously used in version 9 and would like to keep using that, please note that the format needs to change to be useable in version 10.x of the SDK. Please use the [TemplateConverter Tool](https://download2.dynamsoft.com/dcv/TemplateConverter.zip) to convert the template to Barcode Reader version 10 compatible template.
2727

28-
And with that, you have your own template to use with the `InitSettingsFromFile` method!
28+
And with that, you have your own template to use with the `InitSettingsFromFile` method!

faq/general/error-license-buffer.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ When initializing the license for cloud hosted services, it is common to come ac
1717

1818
This error occurs when Dynamsoft sdk attempts to write the license file to the local usr/home directory or Home directory, but is unable to do so due to lack of permission to read or write the license file in that directory.
1919

20-
To resolve this issue, please set the license file cache path to a directory that your program has read and write permissions for.
20+
To resolve this issue, please set the license file cache path to a directory that your program has read and write permissions for. Please place the code before license initializtion.
2121

2222

23-
Code snippet in C++
23+
C++
2424
```C++
2525
static int SetLicenseCachePath(const char* directoryPath)
26-
```
26+
```
27+
Python
28+
```Python
29+
LicenseManager.set_license_cache_path("DIRECTORY-PATH-FOR-LICENSE-CACHE")
30+
```
31+
Java
32+
```Java
33+
BarcodeReader.setLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE");
34+
```
35+
.NET
36+
```.NET
37+
LicenseManager.SetLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE");
38+
```
39+
40+
For more language, please refer to [this page](https://www.dynamsoft.com/barcode-reader/docs/core/). Select the language and then navigate to API Reference -> DynamsoftLicense -> LicenseManager
41+

faq/general/general.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ permalink: /faq/general/general.html
2222
5. [How to scan specific pages of a pdf file?](scan-specific-page.html)
2323

2424
6. [How to scan barcodes on US Driver's Licenses and extract the information?](scan-us-drivers-license.html)
25-
26-
7. [How does your SDK compare to other commercial SDKs?](competitors-comparison.html)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
layout: default-layout
3+
title: How to Scan EAN/UPC with Addon Codes?
4+
keywords: Dynamsoft Barcode Reader, FAQ, tech basic, EAN-2, EAN-5, UPC–A, Add-On, supplement
5+
description: How to Scan EAN/UPC with Addon Codes?
6+
needAutoGenerateSidebar: false
7+
permalink: /faq/general/how-to-scan-ean-upc-with-addon.html
8+
---
9+
10+
# How to Scan EAN/UPC with Addon Codes?
11+
12+
[<< Back to FAQ index](index.md)
13+
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+
16+
Dynamsoft Barcode Reader (DBR) does not enable reading such AddOn Codes by default.
17+
18+
![EAN-13 + EAN-5 on a book](https://www.dynamsoft.com/codepool/img/2024/10/add-on/ean_13.jpg)
19+
![UPC-E + UPC-2 on a magazine](https://www.dynamsoft.com/codepool/img/2024/10/add-on/upc_e.jpg)
20+
21+
To enable AddOn Code scanning, the property `EnableAddOnCode` in the `BarcodeFormatSpecificationOptions` array must be set to 1.
22+
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`.
26+
27+
### Using JSON Templates
28+
29+
Modify all of the `EnableAddOnCode` property in your template file by setting its value to `1`:
30+
```json
31+
{
32+
"BarcodeFormatSpecificationOptions":
33+
[
34+
{
35+
"EnableAddOnCode": 1, // Enable AddOn Codes
36+
"Name": "bfs1",
37+
// (OPTIONAL) Apply Regular Expression Filtering
38+
// Exclude All Other Results Without Addon Codes
39+
"BarcodeTextRegExPattern" : "\\d+-\\d+",
40+
...
41+
},
42+
...
43+
],
44+
"BarcodeReaderTaskSettingOptions" :
45+
[
46+
{ // (OPTIONAL) Restrict Formats to EAN and UPC Only
47+
"BarcodeFormatIds" :
48+
[ "BF_EAN_8", "BF_EAN_13", "BF_UPC_A", "BF_UPC_E" ],
49+
}
50+
],
51+
...
52+
}
53+
```
54+
55+
### Using JavaScript Code
56+
57+
```javascript
58+
let settings = await cvRouter.outputSettings(); // Retrieve the runtime settings
59+
let formatOptionsArray = settings.BarcodeFormatSpecificationOptions;
60+
for (let index = 0; index < formatOptionsArray.length; index++) {
61+
const options = formatOptionsArray[index];
62+
// Enable AddOn Codes
63+
options["EnableAddOnCode"] = 1;
64+
// (OPTIONAL) Apply Regular Expression Filtering
65+
// Exclude Results Without AddOn Codes
66+
options["BarcodeTextRegExPattern"] = "\\d+-\\d+";
67+
}
68+
69+
// -------------------- (OPTIONAL) -------------------------------------------
70+
// Restrict Expected Barcode Formats to EAN and UPC Only
71+
let barcodeOptionsArray = settings.BarcodeReaderTaskSettingOptions;
72+
for (let index = 0; index < barcodeOptionsArray.length; index++) {
73+
const options = barcodeOptionsArray[index];
74+
options["BarcodeFormatIds"] = ["BF_EAN_8", "BF_EAN_13", "BF_UPC_A", "BF_UPC_E"];
75+
}
76+
// ---------------------------------------------------------------------------
77+
78+
await cvRouter.initSettings(settings); // Apply the modified settings
79+
```
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).

faq/general/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ permalink: /faq/general/index.html
4141

4242
7. [How can I sort the barcodes of my image in reading order?](sort-barcodes-image.md)
4343

44+
8. [How to Scan EAN/UPC with Addon Codes?](how-to-scan-ean-upc-with-addon.md)
45+
4446
## [License & Usage](license-usage.md)
4547

4648
1. [Can the SDK work without internet connection?](sdk-works-without-internet.md)

faq/general/license-usage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ permalink: /faq/general/license-usage.html
2828
8. [How does license tracking work with the three standard licensing options - Per Scan, Per Device, Per Concurrent Device?](how-license-tracking-works.html)
2929

3030
9. [When is a new license spot taken when using a per-device licensing model?](new-license-required-per-device-licensing.html)
31+
32+
10. [What will happen if licenses are not renewed in time?](what-happens-if-license-expires.html)

programming/features/barcode-scan-region.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ settings.roi.points[2] = {x:90, y:90};
3333
settings.roi.points[3] = {x:10, y:90};
3434
// Update the settings to a specific template.
3535
await router.updateSettings("ReadSingleBarcode", settings);
36+
//============================================================
37+
// Alternatively, you can set the scan region directly at the image source in a simpler way.
38+
// If you’re using Dynamsoft Camera Enhancer, the following example demonstrates
39+
// how to specify a single scan region without modifying the template.
40+
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance();
41+
cameraEnhancer.setScanRegion({
42+
x: 10,
43+
y: 10,
44+
width: 80,
45+
height: 80,
46+
isMeasuredInPercentage: true,
47+
});
3648
```
3749
>
3850
```c++

programming/features/use-runtimesettings-or-templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Basic steps:
139139

140140
1. Build a JSON template and configure the required parameters
141141
2. Save the template to a file or convert it to string
142-
3. Call method `InitSettingsFromFile` or `InitSettings` to apply the settings
142+
3. Call method `InitSettingsFromFile` (or `InitSettings` if you are using the JavaScript edition) to apply the settings
143143

144144
> Read [Parameter Template Structure]({{ site.parameters }}structure-and-interfaces-of-parameters.html) to learn more about the structure of templates.
145145
@@ -173,7 +173,7 @@ The following steps demonstrates how to specify barcode formats via `JSON Templa
173173

174174
* Save the above template to file `setting.json` or Convert the above content into a string format for the respective programming language.
175175

176-
* Call method `InitSettingsFromFile` or `InitSettings` to apply the settings
176+
* Call method `InitSettingsFromFile` (or `InitSettings` if you are using the JavaScript edition) to apply the settings
177177

178178
<div class="sample-code-prefix template2"></div>
179179
>- JavaScript

0 commit comments

Comments
 (0)