Skip to content

Commit 08482e2

Browse files
Merge pull request #794 from dynamsoft-docs/preview
update to internal commit f5c73f95
2 parents 37f4f9e + 73212ff commit 08482e2

14 files changed

+126
-147
lines changed

_includes/sidelist-faq.html

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
<li>
2-
<a class="otherLinkColour">FAQ</a>
2+
<a href="{{ site.faq_general }}index.html" 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">Dynamsoft Licensing & Usage</a>
9+
<a href="{{ site.faq_general }}license-usage.html">Licensing & Usage</a>
1010
</li>
1111
<li>
12-
<a href="{{ site.faq_general }}configuration.html">Dynamsoft Barcode Reader Configuration</a>
12+
<a href="{{ site.faq_general }}configuration.html">Configuration</a>
1313

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

1919
<li>
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>
20+
<a href="{{ site.faq_general }}error-debug.html">Error & Debug</a>
2721
</li>
2822
</ul>
2923
</li>

faq/general/configuration.md

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

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

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

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

faq/general/custom-settings-template.md

+3-3
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) method, 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] methods, 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-
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.
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.
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/ensure-no-overuse.md

+91-8
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@ title: How to properly use concurrent instance license?
44
keywords: Dynamsoft Barcode Reader, FAQ, Pricing/Licensing, General, ensure no overuse
55
description: How to properly use concurrent instance license?
66
needAutoGenerateSidebar: false
7-
permalink: /faq/general/ensure-no-overuse.html
87
---
98

109
## How to properly use concurrent instance license?
1110

1211
[<< Back to FAQ index](index.md)
1312

14-
The standard way(C++) to use concurrent instance license is:
13+
The standard way to use concurrent instance license is:
1514

16-
* Call method SetMaxConcurrentInstanceCount to set the license count you purchased.
17-
* Update the parameter MaxParallelTasks to align with the purchased quantity.
15+
* Call method `SetMaxConcurrentInstanceCount` to set the license count you purchased.
16+
* Update the parameter `MaxParallelTasks` to align with the purchased quantity.
17+
18+
<div class="sample-code-prefix template2"></div>
19+
>- C++
20+
>- C#
21+
>- Python
22+
>
23+
>
1824
```cpp
1925
int licenseCount = YOUR-PURCHASED-LICENSE-COUNT;
2026
int errorCode = 1;
@@ -31,14 +37,91 @@ The standard way(C++) to use concurrent instance license is:
3137
setting.maxParallelTasks = licenseCount;
3238
cvRouter->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &setting);
3339
// add further process
40+
// CCapturedResult *result = cvRouter->Capture("IMAGE-FILE", CPresetTemplate::PT_READ_BARCODES);
41+
```
42+
>
43+
```csharp
44+
int licenseCount = YOUR-PURCHASED-LICENSE-COUNT;
45+
int errorCode = 0;
46+
string errorMsg;
47+
errorCode = LicenseManager.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
48+
LicenseManager.SetMaxConcurrentInstanceCount(licenseCount)
49+
if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
50+
{
51+
Console.WriteLine("License initialization error: " + errorMsg);
52+
}
53+
else
54+
{
55+
CaptureVisionRouter cvRouter = new CaptureVisionRouter();
56+
SimplifiedCaptureVisionSettings settings;
57+
cvRouter.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
58+
setting.maxParallelTasks = licenseCount;
59+
cvRouter.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
60+
// add code for further process
61+
// CapturedResult result = cvRouter.Capture("IMAGE-FILE", PresetTemplate.PT_READ_BARCODES);
62+
}
63+
```
64+
>
65+
```python
66+
license_count = YOUR-PURCHASED-LICENSE-COUNT
67+
LicenseManager.set_max_concurrent_instance_count(license_count)
68+
error_code, error_msg = LicenseManager.init_license("YOUR-LICENSE-KEY")
69+
if error_code != EnumErrorCode.EC_OK and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED:
70+
print("License initialization error: " + error_msg)
71+
else:
72+
cvr_instance = CaptureVisionRouter()
73+
error_code, error_msg, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES)
74+
settings.max_parallel_tasks = license_count
75+
error_code, error_msg = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES, settings)
76+
# add code for further process
77+
# result_array = cvr_instance.capture_multi_pages("IMAGE-FILE", EnumPresetTemplate.PT_READ_BARCODES)
78+
```
79+
80+
## Managing Instance Limits and Parallel Tasks on a Device
81+
82+
Sometimes, a device may encounter an error indicating that the instance count has exceeded the permitted limit. This typically occurs when the total number of concurrently used instances surpasses the maximum number allowed for the device, either due to over-requesting instances or initiating more parallel decoding tasks than permitted.
83+
84+
### About `SetMaxConcurrentInstanceCount`
85+
86+
The `SetMaxConcurrentInstanceCount` function is used to **declare the maximum number of instances a device is allowed to use**. This count is **managed per device**, not per program.
87+
88+
- If multiple programs are running on the same device and each calls `SetMaxConcurrentInstanceCount`, the device will be allocated **the highest value** among the calls, **not the sum**.
89+
90+
- If `SetMaxConcurrentInstanceCount` is **not called**, the device will by default request **only one instance**, not the full number available from the purchased license quantity.
91+
92+
### About `MaxParallelTasks`
93+
94+
The `MaxParallelTasks` setting defines how many decoding tasks can run in parallel within a single `CaptureVisionRouter` instance. It controls the level of concurrency during barcode processing.
95+
96+
- Each `CaptureVisionRouter` instance will open up to `MaxParallelTasks` decoding tasks simultaneously.
97+
- By default, if `MaxParallelTasks` is **not set, 4 parallel tasks** will be opened.
98+
99+
### How Instance Usage Is Calculated
100+
101+
The actual instance usage on a device is calculated using the following formula:
102+
103+
```text
104+
Total Instance Usage = Number of concurrent programs ×
105+
Number of CaptureVisionRouter instances per program ×
106+
MaxParallelTasks per CaptureVisionRouter instance
34107
```
108+
For example, if two programs are running on the same device, and each creates 2 `CaptureVisionRouter` instances with `MaxParallelTasks = 4`, then the total instance usage is:
109+
110+
`2 programs × 2 instances × 4 tasks = 16 instances`
35111

36-
Sometimes, a device may encounter an error message indicating that the instance count has exceeded the limit. This occurs when a device attempts to request more instances than the license pool has available or to initiate more parallel tasks than requested.
112+
### When Will an Error Occur?
37113

38-
By default, if `SetMaxConcurrentInstanceCount` is not called, your program will obtain the full number of instances from the license. If you request more instances than are available in your license pool, an error will be thrown.
114+
An error will be thrown if the total instance usage on the device exceeds the maximum instance count declared via `SetMaxConcurrentInstanceCount`. This can happen in the following scenarios:
39115

40-
Additionally, if `maxParallelTasks` is not set, 4 parallel tasks will be opened to decode barcodes. If you configure the barcode reading settings to open up more parallel tasks than the number of instances obtained from `SetMaxConcurrentInstanceCount`, an error will be thrown.
116+
- The device tries to open more decoding tasks (via `MaxParallelTasks`) than the number of instances allowed.
117+
- Multiple programs together consume more instances than what the device was granted.
41118

42-
> If you attempt to run two programs on one device, the sum of the number of ParallelTasks opened by the two programs cannot exceed the maximum number of `SetMaxConcurrentInstanceCount` that the two programs set. For example, if one program sets `SetMaxConcurrentInstanceCount`(10) and another program sets `SetMaxConcurrentInstanceCount`(5), and your license has sufficient instances, the device will obtain 10 instances. If one program sets `setting.maxParallelTasks` = 6 and another program sets `setting.maxParallelTasks` = 5, an error will be thrown because the total number of parallel tasks (5+6) exceeds the MaxConcurrentInstanceCount (10).
119+
>Example:
120+
>Program A calls `SetMaxConcurrentInstanceCount(10)` and Program B calls `SetMaxConcurrentInstanceCount(5)`. The device will be allowed to use up to **10 instances**.
121+
>If Program A uses `MaxParallelTasks = 6` and Program B uses `MaxParallelTasks = 5`, and both have only one `CaptureVisionRouter` instance, the total becomes `6 + 5 = 11` which exceeds the limit of 10, causing an error.
43122
123+
### Best Practices
44124

125+
- Always call `SetMaxConcurrentInstanceCount` early to explicitly declare your instance needs.
126+
- Avoid exceeding the limit by carefully managing how many `CaptureVisionRouter` instances and `MaxParallelTasks` for each instance are being used across all running programs on a device.
127+
- Monitor actual usage during development to avoid runtime errors in production.

faq/general/error-license-buffer.md

+3-18
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,10 @@ 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. Please place the code before license initializtion.
20+
To resolve this issue, please set the license file cache path to a directory that your program has read and write permissions for.
2121

2222

23-
C++
23+
Code snippet in C++
2424
```C++
2525
static int SetLicenseCachePath(const char* directoryPath)
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-
26+
```

faq/general/general.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ 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)

faq/general/how-to-scan-ean-upc-with-addon.md

-83
This file was deleted.

faq/general/index.md

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ 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-
4644
## [License & Usage](license-usage.md)
4745

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

faq/general/license-usage.md

-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ 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)

index.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ To explore the latest features and updates of `Dynamsoft Barcode Reader`, please
2323
* ![Java Icon]({{site.assets}}img-icon/homepage/java.svg){:class="java"} [Java]({{ site.java }}){:target="_blank"}
2424
* ![.NET Icon]({{site.assets}}img-icon/homepage/dotnet.svg){:class="dotnet"} [.NET]({{ site.dotnet }}){:target="_blank"}
2525
* ![C++ Icon]({{site.assets}}img-icon/homepage/cplusplus.svg){:class="cplusplus"} [C++]({{ site.cpp }}){:target="_blank"}
26+
* ![NodeJS Icon]({{site.assets}}img-icon/homepage/nodejs.svg){:class="nodejs"} [Node JS](https://github.com/Dynamsoft/capture-vision-nodejs-samples/){:target="_blank"}
2627

2728
The documentation for editions `C`, `React Native`, `Flutter`, `Xamarin.Forms` and `Cordova` has been archived, but remains accessible through the following links:
2829

license-activation/index.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ The following shows how to set the license in the code.
3838
>
3939
>
4040
```js
41-
Dynamsoft.License.LicenseManager.initLicense("YOUR-LICENSE-KEY");
41+
// Option 1: Initialize using the RTU (Ready-To-Use) BarcodeScanner APIs
42+
const barcodeScanner = new Dynamsoft.BarcodeScanner({
43+
license: "YOUR_LICENSE_KEY",
44+
});
45+
// Option 2: Initialize the license using the Foundational APIs
46+
Dynamsoft.License.LicenseManager.initLicense("YOUR_LICENSE_KEY");
4247
```
4348
>
4449
```c
@@ -116,5 +121,5 @@ else:
116121
# add code for further process
117122
```
118123

119-
If you are using a `concurrent instance license`, see [Concurrent Instance License Initialization](concurrent-instance-license.html) for more information.
124+
If you are using a `concurrent instance license`, see [How to properly use concurrent instance license]({{ site.faq_general }}ensure-no-overuse.html) for more information.
120125

0 commit comments

Comments
 (0)