Skip to content

Commit 7836e7c

Browse files
Merge pull request #476 from dynamsoft-docs/preview
Preview
2 parents d178dd0 + c4ed934 commit 7836e7c

File tree

16 files changed

+248
-90
lines changed

16 files changed

+248
-90
lines changed

_includes/sidelist-programming/programming-javascript.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,10 @@
16421642
<a href="{{ site.js }}faq/camera-cannot-open-in-pwa.html"
16431643
>How to Resolve Camera Cannot Open in PWA Using Dynamsoft Barcode Reader on iOS?</a>
16441644
</li>
1645+
<li>
1646+
<a href="{{ site.js }}faq/adaptive-wasm-loading.html"
1647+
>What Is Adaptive WebAssembly (Wasm) Loading and How Does It Work?</a>
1648+
</li>
16451649
</ul>
16461650
</li>
16471651
<li lang="javascript"><a href="{{ site.license_activation }}index.html" class="otherLinkColour">License Initialization</a></li>

_includes/sidelist-programming/sidelist-parameters.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@
266266
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-addon-code.html" class="otherLinkColour">EnableAddOnCode</a></li>
267267
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-data-matrix-ecc000-140.html" class="otherLinkColour">EnableDataMatrixECC000-140</a></li>
268268
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/enable-qr-code-model-1.html" class="otherLinkColour">EnableQRCodeModel1</a></li>
269+
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/expected-barcodes-count.html" class="otherLinkColour">ExpectedBarcodesCount</a></li>
269270
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/find-uneven-module-barcode.html" class="otherLinkColour">FindUnevenModuleBarcode</a></li>
271+
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/has-vertical-quietzone.html" class="otherLinkColour">HasVerticalQuietZone</a></li>
270272
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/head-module-ratio.html" class="otherLinkColour">HeadModuleRatio</a></li>
271273
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/include-implied-ai01.html" class="otherLinkColour">IncludeImpliedAI01</a></li>
272274
<li><a href="{{ site.dcvb_parameters }}barcode-format-specification/include-trailing-check-digit.html" class="otherLinkColour">IncludeTrailingCheckDigit</a></li>
@@ -299,7 +301,8 @@
299301
</li>
300302
<li><a href="{{ site.dcvb_parameter_file }}auxiliary/global-parameter.html" class="otherLinkColour">Global Parameter</a>
301303
<ul>
302-
<li><a href="{{ site.dcvb_parameters }}global-parameter/max-total-image-dimension.html" class="otherLinkColour">MaxTotalImageDimension</a></li>
304+
<li><a href="{{ site.dcvb_parameters_file }}auxiliary/global-parameter.html#maxtotalimagedimension" class="otherLinkColour">MaxTotalImageDimension</a></li>
305+
<li><a href="{{ site.dcvb_parameters_file }}auxiliary/global-parameter.html#intraopnumthreads" class="otherLinkColour">IntraOpNumThreads</a></li>
303306
</ul>
304307
</li>
305308
<li><a href="{{ site.dcvb_parameter_file }}semantic-processing/index.html" class="otherLinkColour">SemanticProcessing Object</a>

programming/javascript/api-reference/barcode-scanner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ interface BarcodeScannerConfig {
178178
// engineResourcePaths typically is only assigned when using a framework like React/Angular/Vue where the resources are not in the same location as the script reference.
179179
engineResourcePaths: {rootDirectory:"https://cdn.jsdelivr.net/npm/"},
180180
// path to the UI file
181-
uiPath: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.6000/dist/ui/barcode-scanner.ui.xml",
181+
uiPath: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.2.2000/dist/ui/barcode-scanner.ui.xml",
182182
barcodeFormats: [Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE , Dynamsoft.DBR.EnumBarcodeFormat.BF_CODE_128],
183183
showPoweredByDynamsoft: false,
184184
duplicateForgetTime: 3000,
@@ -187,7 +187,7 @@ interface BarcodeScannerConfig {
187187
// The container for rendering the scanner and/or result view. Note that ResultView is only valid for SM_MULTI_UNIQUE mode. If not specified, a full-viewport default UI will be created.
188188
container: "#camera-view-container",
189189
scannerViewConfig: {
190-
// The ResultViewConfig goes in here - see ResultViewConfig section
190+
// The ScannerViewConfig goes in here - see ScannerViewConfig section
191191
},
192192
resultViewConfig: {
193193
// The ResultViewConfig goes in here - see ResultViewConfig section

programming/javascript/api-reference/enum-localization-mode.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,31 @@ codeAutoHeight: true
2020
>
2121
```javascript
2222
enum EnumLocalizationMode {
23-
/** Omits the localization process entirely. */
24-
LM_SKIP = 0x00,
2523
/** Automatic localization mode selection; not yet implemented. */
26-
LM_AUTO = 0x01,
24+
LM_AUTO = 1,
2725
/** Identifies barcodes by finding connected blocks, offering optimal results, especially recommended for highest priority in most scenarios. */
28-
LM_CONNECTED_BLOCKS = 0x02,
26+
LM_CONNECTED_BLOCKS = 2,
2927
/** Detects barcodes through analysis of patterns of contiguous black and white regions, tailored for QR Codes and DataMatrix codes. */
30-
LM_STATISTICS = 0x04,
28+
LM_STATISTICS = 4,
3129
/** Locates barcodes by identifying linear patterns, designed primarily for 1D barcodes and PDF417 codes. */
32-
LM_LINES = 0x08,
30+
LM_LINES = 8,
3331
/** Provides rapid barcode localization, suited for interactive applications where speed is crucial. */
34-
LM_SCAN_DIRECTLY = 0x10,
32+
LM_SCAN_DIRECTLY = 16,
3533
/** Targets barcode localization through detection of specific mark groups, optimized for Direct Part Marking (DPM) codes. */
36-
LM_STATISTICS_MARKS = 0x20,
34+
LM_STATISTICS_MARKS = 32,
3735
/** Combines methods of locating connected blocks and linear patterns to efficiently localize postal codes. */
38-
LM_STATISTICS_POSTAL_CODE = 0x40,
36+
LM_STATISTICS_POSTAL_CODE = 64,
3937
/** Initiates barcode localization from the image center, facilitating faster detection in certain layouts. */
40-
LM_CENTRE = 0x80,
38+
LM_CENTRE = 128,
4139
/** Specialized for quick localization of 1D barcodes, enhancing performance in fast-scan scenarios. */
42-
LM_ONED_FAST_SCAN = 0x100,
43-
/** Placeholder value with no functional meaning. */
44-
LM_END=0xFFFFFFFF,
40+
LM_ONED_FAST_SCAN = 256,
41+
/**Localizes barcodes by utilizing a neural network model. Introduced in Dynamsoft Barcode Reader Bundle version 11.2.2000. */
42+
LM_NEURAL_NETWORK = 512,
4543
/** Reserved for future use in localization mode settings. */
46-
LM_REV = -2147483648
44+
LM_REV = -2147483648,
45+
/** Omits the localization process entirely. */
46+
LM_SKIP = 0,
47+
/** Placeholder value with no functional meaning. */
48+
LM_END = -1
4749
}
4850
```
49.9 KB
Loading
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
layout: default-layout
3+
title: About Adaptive WebAssembly (Wasm) Loading
4+
keywords: Dynamsoft Barcode Reader, FAQ, JavaScript, tech basic, wasm, loading
5+
description: How to enable -SIMD-Pthread Wasm for accelerated deep learning computation?
6+
needAutoGenerateSidebar: false
7+
---
8+
9+
# About Adaptive WebAssembly (Wasm) Loading
10+
11+
## What is adaptive Wasm loading?
12+
13+
Dynamsoft Barcode Reader(JavaScript) includes **three optimized WebAssembly (Wasm) variants***-Baseline*, *-Pthread*, and *-SIMD-Pthread* — which can be **dynamically loaded based on the runtime environment**.
14+
This adaptive loading mechanism ensures the SDK automatically selects the **most compatible and highest-performing** Wasm module available in each browser, further improving performance in modern environments.
15+
16+
---
17+
18+
## Comparison of the three Wasm variants
19+
20+
| Feature | Baseline Wasm | SIMD Wasm | SIMD + Pthread Wasm |
21+
| -------- | -------------- | ---------- | -------------------- |
22+
| **Parallelism** | Single-threaded | Single Instruction Multiple Data (CPU vector instruction set) | Multi-threaded(via Web Workers + SharedArrayBuffer) + SIMD |
23+
| **Performance Characteristics** | Simple, limited by single-core performance | Leverages CPU vectorized parallelism to speed up data processing | Combines SIMD vectorization and multi-core acceleration for maximum performance |
24+
| **Compatibility** | Supported in all Wasm environments | Requires browser support for Wasm SIMD instruction set | Requires browser support for both Wasm SIMD and Wasm threads (cross-origin isolation) |
25+
| **Minimum Supported Browser Versions** | Chrome 78+<br>Edge 79+<br>Safari 14.5+<br>Firefox 68+ | Chrome 91+<br>Edge 91+<br>Safari 16.4+<br>Firefox 89+ | Chrome 91+<br>Edge 91+<br>Safari 16.4+<br>Firefox 89+ |
26+
| **Wasm Size** | 5588 KB | 6974 KB | 8225 KB |
27+
| **Transfer Size** | 2.11 MB | 2.55 MB | 2.81 MB |
28+
29+
---
30+
31+
## How to enable -SIMD-Pthread Wasm for accelerated deep learning computation?
32+
33+
To unlock multi-threaded performance with the **-SIMD-Pthread Wasm** variant, configure your server to enable **cross-origin isolation** by adding the following HTTP headers to all responses:
34+
35+
```text
36+
Cross-Origin-Opener-Policy: same-origin
37+
Cross-Origin-Embedder-Policy: require-corp
38+
```
39+
40+
Then, ensure that all SDK resources are **served under the same origin**.
41+
42+
Once correctly configured, the SDK will automatically detect the environment and load the `-SIMD-Pthread Wasm` to leverage multi-core acceleration.
43+
44+
>[!TIP]
45+
>You can verify whether your site is correctly isolated by checking the browser console for cross-origin isolation status or by calling window.crossOriginIsolated in DevTools.
46+
47+
## How to manually specify which Wasm variant to load?
48+
49+
By default, the SDK automatically determines the most suitable WebAssembly (Wasm) variant to load based on the browser’s capabilities.
50+
However, developers can **manually override** this behavior and explicitly specify which Wasm module to load through the `wasmLoadOptions` property.
51+
52+
### Example
53+
54+
```javascript
55+
Dynamsoft.Core.CoreModule.wasmLoadOptions = {
56+
wasmType: "ml-simd-pthread",
57+
pthreadPoolSize: 5,
58+
};
59+
```
60+
61+
### Supported Wasm Types
62+
63+
```javascript
64+
type WasmType =
65+
| "baseline" // Basic single-threaded variant
66+
| "ml-simd" // SIMD-optimized variant
67+
| "ml-simd-pthread" // Multi-threaded + SIMD optimized variant
68+
| "auto"; // Automatically select based on environment
69+
```
70+
71+
>[!NOTE]
72+
>Setting wasmType to "auto" (default) allows the SDK to automatically choose the optimal Wasm based on runtime capability detection.
73+
>
74+
>When using "ml-simd-pthread", ensure that cross-origin isolation is properly configured as described in [How to enable `-SIMD-Pthread Wasm` for accelerated deep learning computation](#how-to-enable--simd-pthread-wasm-for-accelerated-deep-learning-computation).
75+
>
76+
>If the specified Wasm variant is not supported in the current browser, the SDK will gracefully fall back to a compatible variant.
77+
78+
## Why isn’t -SIMD-Pthread Wasm enabled by default on iOS?
79+
80+
Due to iOS’s strict memory allocation and management limitations, loading `-SIMD-Pthread Wasm` can sometimes lead to “out of memory” errors on older devices or iOS versions.
81+
To ensure stability and compatibility, the SDK does not load `-SIMD-Pthread Wasm` by default on iOS. Instead, it automatically falls back to the most suitable Baseline or SIMD variant depending on the environment.

programming/javascript/faq/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ noTitleIndex: true
8787

8888
39. [How to Enable Specific Barcode Formats with Your License?](enable-supported-barcode-format.html)
8989

90-
40. [How to Resolve Camera Cannot Open in PWA Using Dynamsoft Barcode Reader on iOS](camera-cannot-open-in-pwa.html)
90+
40. [How to Resolve Camera Cannot Open in PWA Using Dynamsoft Barcode Reader on iOS?](camera-cannot-open-in-pwa.html)
91+
92+
41. [What Is Adaptive WebAssembly (Wasm) Loading and How Does It Work?](adaptive-wasm-loading.md)

programming/javascript/release-notes/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ breadcrumbText: Release Notes
99

1010
# DBR JavaScript SDK - Release Notes
1111

12+
- [11.2.2000 (11/04/2025)](js-11.html#1122000-11042025)
1213
- [11.0.6000 (08/14/2025)](js-11.html#1106000-08142025)
1314
- [11.0.3000 (07/09/2025)](js-11.html#1103000-07092025)
1415
- [10.5.3000 (04/24/2025)](js-10.html#1053000-04242025)

programming/javascript/release-notes/js-11.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,69 @@ noTitleIndex: true
1010

1111
# Release Notes for Dynamsoft Barcode Reader JavaScript SDK
1212

13+
## 11.2.2000 (11/04/2025)
14+
15+
### ✨ Key Highlights
16+
#### AI-Powered Barcode Detection and Decoding
17+
18+
- New Localization Models – Introduces [`OneDLocalization`]({{ site.dcvb_parameters }}barcode-reader-task-settings/localization-modes.html#modelnamearray) and [`DataMatrixQRCodeLocalization`]({{ site.dcvb_parameters }}barcode-reader-task-settings/localization-modes.html#modelnamearray) neural network models for improved detection of **blurred / low-resolution 1D codes**, or **partially damaged DataMatrix/QR codes**.
19+
- Specialized Decoders – Adds [`EAN13Decoder`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) and [`Code128Decoder`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) models optimized for **long-distance** and **motion-blurred** decoding scenarios.
20+
- Redesigned Deblur Model – The [`OneDDeblur`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#modelnamearray) model now provides more effective recovery from **motion and focus blur**.
21+
- Configurable Model Selection – The new `ModelNameArray` parameter supports flexible model loading and fine-grained control for specific barcode types.
22+
23+
#### Precision and Processing Control
24+
25+
- Enhanced Deblur Methods – [`DM_DEEP_ANALYSIS`]({{ site.dcvb_parameters }}barcode-reader-task-settings/deblur-modes.html#dm_deep_analysis) now includes sub-level control with `OneDGeneral`, `TwoDGeneral`, and `EAN13Enhanced` options.
26+
- Barcode Count Expectation – The new [`ExpectedBarcodesCount`]({{ site.dcvb_parameters }}barcode-format-specification/expected-barcodes-count.html) parameter enables **format-specific quantity control** and **early termination** in fixed-count workflows.
27+
- Improved Region Detection – The new [`RPM_GRAY_CONSISTENCY`]({{ site.dcvb_parameters }}image-parameter/region-predetection-modes.html#rpm_gray_consistency) mode provides more precise region extraction based on **grayscale uniformity** and **local consistency** for document and label processing.
28+
29+
### Performance Highlights
30+
31+
- Up to **26.5%** higher read rates under blur conditions with as much as **44%** faster processing.
32+
- Reliable decoding of DataMatrix and QR codes with missing or damaged finder patterns.
33+
- Extended operational range beyond 75 cm for long-distance barcode scanning.
34+
35+
### Developer Notes
36+
37+
- Backward Compatibility – Fully compatible with existing integrations; no code-level changes required for upgrade.
38+
- Configuration Flexibility – Expanded parameter set allows comprehensive model configuration for scenario-specific tuning.
39+
- Production Stability – All new models validated in enterprise environments.
40+
41+
#### Updates for [BarcodeScanner](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html)
42+
43+
- In **single** mode, if the target barcode is not found among the candidates, there is now an opportunity to rescan.
44+
<img src="../assets/return-button.png" style="display: block; margin: 0 auto;"/>
45+
- Fixed an issue where the barcode location could be inaccurate in certain cases.
46+
- Fixed a problem where, in specific cases when the camera was occupied, the video stream could not be displayed correctly.
47+
- Other known issues fixed.
48+
49+
#### Engineering Optimizations
50+
51+
- Optimized the parallel download logic to improve resource loading speed.
52+
- Optimized [adaptive WASM loading logic](../faq/adaptive-wasm-loading.md) to further enhance performance in modern browser environments.
53+
54+
### API Changes
55+
56+
#### New
57+
58+
- Added the `switchCapturingTemplate()` method to the `CaptureVisionRouter` class to enable switching the active capturing template during the image processing workflow.
59+
- Added methods `toBlob()`, `toImage()`, and `toCanvas()` to the `originalImageResultItem` interface for flexible image data conversion.
60+
- Added the `SetGlobalIntraOpNumThreads()` method to the `CaptureVisionRouter` class to configure the global thread count for model inference.
61+
- Added the `clearDLModelBuffers()` method to the `CaptureVisionRouter` class to manually release memory occupied by loaded models.
62+
- Added callback functions `onSpecLoadProgressChanged()` and `onWasmLoadProgressChanged()` to monitor resource loading progress.
63+
- Added the `convertToContainCoordinates()` method to the `CameraEnhancer` class to convert coordinates from `fit: cover` to `fit: contain` mode.
64+
- Added the `LM_NEURAL_NETWORK` enumeration to `EnumLocalizationMode`.
65+
66+
#### Updated
67+
68+
- Changed the default value of `MaxThreadsInOneTask` from **4** to **0**.
69+
- Changed the default value of `IncludeTrailingCheckDigit` from **1** to **0**.
70+
71+
#### Deprecated
72+
73+
- Deprecated the `DeblurModelNameArray` argument in the `DeblurModes` parameter. Use `ModelNameArray` instead.
74+
- Deprecated the `appendModelBuffer()` method in the `CaptureVisionRouter` class. Use `appendDLModelBuffer()` instead.
75+
1376
## 11.0.6000 (08/14/2025)
1477

1578
### New

programming/javascript/samples-demos/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ needAutoGenerateSidebar: false
112112
templates for scanning various barcode types."><a class="button title" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html">Use Customized Template</a><span id="icon001" class="tooltipIcon"></span>
113113
<a class="github" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html" title="Check code on GitHub"></a></span>
114114
</div>
115+
<div class="file"><span data-balloon-length="large" data-balloon-pos="up" aria-label="Read the GS1-AI barcode and parse it."><a class="button title" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html">Read the GS1-AI Barcode and Parse It</a><span id="icon042" class="tooltipIcon"></span>
116+
<a class="github" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html" title="Check code on GitHub"></a></span>
117+
</div>
115118
<div class="file"><span data-balloon-length="large" data-balloon-pos="down" aria-label="Read barcodes from camera and images in Angular
116119
Application."><a class="button title" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/angular">Hello World in
117120
Angular (<img alt="Angular logo"
@@ -378,9 +381,6 @@ needAutoGenerateSidebar: false
378381
<div class="file"><span data-balloon-length="large" data-balloon-pos="up" aria-label="Locate an item quickly by scanning barcodes."><a class="button title" href="https://demo.dynamsoft.com/Samples/DBR/JS/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html">Find Item via Barcode</a><span id="icon042" class="tooltipIcon"></span>
379382
<a class="github" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html" title="Check code on GitHub"></a></span>
380383
</div>
381-
<div class="file"><span data-balloon-length="large" data-balloon-pos="up" aria-label="Read the GS1-AI barcode and parse it."><a class="button title" href="https://demo.dynamsoft.com/Samples/DBR/JS/foundational-api-samples/use-case/read-and-parse-GS1-AI/index.html">Read the GS1-AI Barcode and Parse It</a><span id="icon042" class="tooltipIcon"></span>
382-
<a class="github" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/foundational-api-samples/use-case/read-and-parse-GS1-AI/index.html" title="Check code on GitHub"></a></span>
383-
</div>
384384
</div>
385385
<div class="file">Others</div>
386386
<div class="children">

0 commit comments

Comments
 (0)