dynamsoft-barcode-reader-bundle 11.4.2000-beta-202604152312 → 11.4.2000-beta-202604162228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.html +12 -12
- package/README.md +12 -12
- package/dist/dbr.bundle.esm.js +2 -2
- package/dist/dbr.bundle.js +2 -2
- package/dist/dbr.bundle.mjs +2 -2
- package/dist/dbr.bundle.worker.js +2 -2
- package/package.json +2 -2
- package/samples.url +1 -1
package/README.html
CHANGED
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
cvRouter.setInput(cameraEnhancer);
|
|
297
297
|
|
|
298
298
|
<span class="hljs-keyword">const</span> resultsContainer = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#results"</span>);
|
|
299
|
-
cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =></span> {
|
|
299
|
+
<span class="hljs-keyword">await</span> cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =></span> {
|
|
300
300
|
<span class="hljs-keyword">if</span> (result.barcodeResultItems?.length) {
|
|
301
301
|
resultsContainer.textContent = <span class="hljs-string">''</span>;
|
|
302
302
|
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> item <span class="hljs-keyword">of</span> result.barcodeResultItems) {
|
|
@@ -471,7 +471,7 @@ Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = <span class="hljs-
|
|
|
471
471
|
<h3 id="step-1-preload-the-module">Step 1: Preload the module</h3>
|
|
472
472
|
<p>The image processing logic is encapsulated within .wasm library files, and these files may require some time for downloading. To enhance the speed, we advise utilizing the following method to preload the libraries.</p>
|
|
473
473
|
<pre><code class="hljs js language-js"><span class="hljs-comment">// Preload the .wasm files</span>
|
|
474
|
-
|
|
474
|
+
Dynamsoft.Core.CoreModule.loadWasm();
|
|
475
475
|
</code></pre>
|
|
476
476
|
<h3 id="step-2-create-a-capturevisionrouter-object">Step 2: Create a CaptureVisionRouter object</h3>
|
|
477
477
|
<p>To use the SDK, we first create a <code>CaptureVisionRouter</code> object.</p>
|
|
@@ -523,11 +523,11 @@ resultReceiver.onDecodedBarcodesReceived = <span class="hljs-function">(<span c
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
|
-
cvRouter.addResultReceiver(resultReceiver);
|
|
526
|
+
<span class="hljs-keyword">await</span> cvRouter.addResultReceiver(resultReceiver);
|
|
527
527
|
</code></pre>
|
|
528
528
|
<p>You can also write code like this. It is the same.</p>
|
|
529
529
|
<pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">const</span> resultsContainer = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#results"</span>);
|
|
530
|
-
cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =></span> {
|
|
530
|
+
<span class="hljs-keyword">await</span> cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =></span> {
|
|
531
531
|
<span class="hljs-keyword">if</span> (result.barcodeResultItems?.length) {
|
|
532
532
|
resultsContainer.textContent = <span class="hljs-string">''</span>;
|
|
533
533
|
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> item <span class="hljs-keyword">of</span> result.barcodeResultItems) {
|
|
@@ -619,7 +619,7 @@ settings.barcodeSettings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_Q
|
|
|
619
619
|
<p>Please be aware that it is necessary to update the <code>CapturedResultReceiver</code> object to obtain the original image. For instance:</p>
|
|
620
620
|
<pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">const</span> EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType; <span class="hljs-comment">// Enum for captured result item types.</span>
|
|
621
621
|
<span class="hljs-comment">// Create a result receiver to handle the results.</span>
|
|
622
|
-
cvRouter.addResultReceiver({
|
|
622
|
+
<span class="hljs-keyword">await</span> cvRouter.addResultReceiver({
|
|
623
623
|
<span class="hljs-comment">// This function is called when any capture result is received.</span>
|
|
624
624
|
<span class="hljs-attr">onCapturedResultReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =></span> {
|
|
625
625
|
<span class="hljs-comment">//Check for barcode results</span>
|
|
@@ -745,24 +745,24 @@ resultReceiver.onDecodedBarcodesReceived = <span class="hljs-function">(<span cl
|
|
|
745
745
|
Dynamsoft.DCE.Feedback.beep();
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
|
-
cvRouter.addResultReceiver(resultReceiver);
|
|
748
|
+
<span class="hljs-keyword">await</span> cvRouter.addResultReceiver(resultReceiver);
|
|
749
749
|
</code></pre>
|
|
750
750
|
<h2 id="customizing-the-ui">Customizing the UI</h2>
|
|
751
751
|
<pre><code class="hljs javascript language-javascript"><span class="hljs-comment">// Create a CameraView instance with default settings</span>
|
|
752
752
|
<span class="hljs-keyword">let</span> cameraView = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance();
|
|
753
|
-
<span class="hljs-comment">// Create a CameraView instance with a specified
|
|
754
|
-
<span class="hljs-keyword">let</span> cameraView1 = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance(<span class="hljs-string">'@engineResourcePath/dce.
|
|
753
|
+
<span class="hljs-comment">// Create a CameraView instance with a specified XML file path, typically a local or remote URL</span>
|
|
754
|
+
<span class="hljs-keyword">let</span> cameraView1 = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance(<span class="hljs-string">'@engineResourcePath/dce.ui.v5.xml'</span>);
|
|
755
755
|
<span class="hljs-comment">// Create a CameraView instance within a specified DOM element</span>
|
|
756
756
|
<span class="hljs-keyword">let</span> cameraView2 = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance(<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'my-ui'</span>));
|
|
757
757
|
<span class="hljs-comment">// Create a CameraView instance using a custom UI file path</span>
|
|
758
|
-
<span class="hljs-keyword">let</span> cameraView3 = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance(<span class="hljs-string">'url/to/my/ui.
|
|
758
|
+
<span class="hljs-keyword">let</span> cameraView3 = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance(<span class="hljs-string">'url/to/my/ui.xml'</span>);
|
|
759
759
|
|
|
760
760
|
<span class="hljs-comment">// Get the UI element associated with the cameraView instance</span>
|
|
761
761
|
<span class="hljs-keyword">let</span> uiElement = cameraView.getUIElement();
|
|
762
762
|
<span class="hljs-comment">// Remove the camera selection dropdown from the CameraView's UI element</span>
|
|
763
|
-
uiElement.
|
|
763
|
+
uiElement.querySelector(<span class="hljs-string">'.dce-sel-camera'</span>).remove();
|
|
764
764
|
<span class="hljs-comment">// Remove the resolution selection dropdown from the CameraView's UI element</span>
|
|
765
|
-
uiElement.
|
|
765
|
+
uiElement.querySelector(<span class="hljs-string">'.dce-sel-resolution'</span>).remove();
|
|
766
766
|
</code></pre>
|
|
767
767
|
<p>The UI is part of the auxiliary SDK "Dynamsoft Camera Enhancer", read more on how to <a href="https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/ui-customization-js.html?lang=js">customize the UI</a>.</p>
|
|
768
768
|
<h2 id="documentation">Documentation</h2>
|
|
@@ -800,7 +800,7 @@ The following table is a list of supported browsers based on the above requireme
|
|
|
800
800
|
|
|
801
801
|
| Browser Name | Version |
|
|
802
802
|
| :----------: | :--------------: |
|
|
803
|
-
| Chrome |
|
|
803
|
+
| Chrome | v88+<sup>1</sup> |
|
|
804
804
|
| Firefox | v68+<sup>1</sup> |
|
|
805
805
|
| Edge | v79+ |
|
|
806
806
|
| Safari | v14+ |
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ The complete code of the "Hello World" example is shown below
|
|
|
83
83
|
cvRouter.setInput(cameraEnhancer);
|
|
84
84
|
|
|
85
85
|
const resultsContainer = document.querySelector("#results");
|
|
86
|
-
cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
|
|
86
|
+
await cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
|
|
87
87
|
if (result.barcodeResultItems?.length) {
|
|
88
88
|
resultsContainer.textContent = '';
|
|
89
89
|
for (let item of result.barcodeResultItems) {
|
|
@@ -304,7 +304,7 @@ The image processing logic is encapsulated within .wasm library files, and these
|
|
|
304
304
|
|
|
305
305
|
```js
|
|
306
306
|
// Preload the .wasm files
|
|
307
|
-
|
|
307
|
+
Dynamsoft.Core.CoreModule.loadWasm();
|
|
308
308
|
```
|
|
309
309
|
|
|
310
310
|
### Step 2: Create a CaptureVisionRouter object
|
|
@@ -375,14 +375,14 @@ resultReceiver.onDecodedBarcodesReceived = (result) => {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
|
-
cvRouter.addResultReceiver(resultReceiver);
|
|
378
|
+
await cvRouter.addResultReceiver(resultReceiver);
|
|
379
379
|
```
|
|
380
380
|
|
|
381
381
|
You can also write code like this. It is the same.
|
|
382
382
|
|
|
383
383
|
```javascript
|
|
384
384
|
const resultsContainer = document.querySelector("#results");
|
|
385
|
-
cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
|
|
385
|
+
await cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
|
|
386
386
|
if (result.barcodeResultItems?.length) {
|
|
387
387
|
resultsContainer.textContent = '';
|
|
388
388
|
for (let item of result.barcodeResultItems) {
|
|
@@ -469,7 +469,7 @@ Please be aware that it is necessary to update the `CapturedResultReceiver` obje
|
|
|
469
469
|
```javascript
|
|
470
470
|
const EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType; // Enum for captured result item types.
|
|
471
471
|
// Create a result receiver to handle the results.
|
|
472
|
-
cvRouter.addResultReceiver({
|
|
472
|
+
await cvRouter.addResultReceiver({
|
|
473
473
|
// This function is called when any capture result is received.
|
|
474
474
|
onCapturedResultReceived: (result) => {
|
|
475
475
|
//Check for barcode results
|
|
@@ -634,7 +634,7 @@ resultReceiver.onDecodedBarcodesReceived = (result) => {
|
|
|
634
634
|
Dynamsoft.DCE.Feedback.beep();
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
|
-
cvRouter.addResultReceiver(resultReceiver);
|
|
637
|
+
await cvRouter.addResultReceiver(resultReceiver);
|
|
638
638
|
```
|
|
639
639
|
|
|
640
640
|
## Customizing the UI
|
|
@@ -642,19 +642,19 @@ cvRouter.addResultReceiver(resultReceiver);
|
|
|
642
642
|
```javascript
|
|
643
643
|
// Create a CameraView instance with default settings
|
|
644
644
|
let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
|
|
645
|
-
// Create a CameraView instance with a specified
|
|
646
|
-
let cameraView1 = await Dynamsoft.DCE.CameraView.createInstance('@engineResourcePath/dce.
|
|
645
|
+
// Create a CameraView instance with a specified XML file path, typically a local or remote URL
|
|
646
|
+
let cameraView1 = await Dynamsoft.DCE.CameraView.createInstance('@engineResourcePath/dce.ui.v5.xml');
|
|
647
647
|
// Create a CameraView instance within a specified DOM element
|
|
648
648
|
let cameraView2 = await Dynamsoft.DCE.CameraView.createInstance(document.getElementById('my-ui'));
|
|
649
649
|
// Create a CameraView instance using a custom UI file path
|
|
650
|
-
let cameraView3 = await Dynamsoft.DCE.CameraView.createInstance('url/to/my/ui.
|
|
650
|
+
let cameraView3 = await Dynamsoft.DCE.CameraView.createInstance('url/to/my/ui.xml');
|
|
651
651
|
|
|
652
652
|
// Get the UI element associated with the cameraView instance
|
|
653
653
|
let uiElement = cameraView.getUIElement();
|
|
654
654
|
// Remove the camera selection dropdown from the CameraView's UI element
|
|
655
|
-
uiElement.
|
|
655
|
+
uiElement.querySelector('.dce-sel-camera').remove();
|
|
656
656
|
// Remove the resolution selection dropdown from the CameraView's UI element
|
|
657
|
-
uiElement.
|
|
657
|
+
uiElement.querySelector('.dce-sel-resolution').remove();
|
|
658
658
|
```
|
|
659
659
|
|
|
660
660
|
The UI is part of the auxiliary SDK "Dynamsoft Camera Enhancer", read more on how to [customize the UI](https://www.dynamsoft.com/barcode-reader/docs/core/programming/features/ui-customization-js.html?lang=js).
|
|
@@ -697,7 +697,7 @@ The following table is a list of supported browsers based on the above requireme
|
|
|
697
697
|
|
|
698
698
|
| Browser Name | Version |
|
|
699
699
|
| :----------: | :--------------: |
|
|
700
|
-
| Chrome |
|
|
700
|
+
| Chrome | v88+<sup>1</sup> |
|
|
701
701
|
| Firefox | v68+<sup>1</sup> |
|
|
702
702
|
| Edge | v79+ |
|
|
703
703
|
| Safari | v14+ |
|