dynamsoft-barcode-reader-bundle 10.2.1000-beta-202405192313 → 10.2.1000

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 CHANGED
@@ -300,20 +300,20 @@
300
300
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
301
301
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"cameraViewContainer"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; height: 60vh"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
302
302
  <span class="hljs-tag">&lt;<span class="hljs-name">textarea</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"results"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; min-height: 10vh; font-size: 3vmin; overflow: auto"</span> <span class="hljs-attr">disabled</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">textarea</span>&gt;</span>
303
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
303
+ <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
304
304
  <span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript">
305
305
  Dynamsoft.License.LicenseManager.initLicense(<span class="hljs-string">"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"</span>);
306
306
  Dynamsoft.Core.CoreModule.loadWasm([<span class="hljs-string">"dbr"</span>]);
307
307
  <span class="hljs-function">(<span class="hljs-params"><span class="hljs-keyword">async</span> (</span>) =&gt;</span> {
308
- <span class="hljs-keyword">let</span> router = <span class="hljs-keyword">await</span> Dynamsoft.CVR.CaptureVisionRouter.createInstance();
308
+ <span class="hljs-keyword">let</span> cvRouter = <span class="hljs-keyword">await</span> Dynamsoft.CVR.CaptureVisionRouter.createInstance();
309
309
 
310
310
  <span class="hljs-keyword">let</span> view = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance();
311
311
  <span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(view);
312
312
  <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#cameraViewContainer"</span>).append(view.getUIElement());
313
- router.setInput(cameraEnhancer);
313
+ cvRouter.setInput(cameraEnhancer);
314
314
 
315
315
  <span class="hljs-keyword">const</span> resultsContainer = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#results"</span>);
316
- router.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
316
+ cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
317
317
  <span class="hljs-keyword">if</span> (result.barcodeResultItems.length &gt; <span class="hljs-number">0</span>) {
318
318
  resultsContainer.textContent = <span class="hljs-string">''</span>;
319
319
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> item <span class="hljs-keyword">of</span> result.barcodeResultItems) {
@@ -325,10 +325,10 @@
325
325
  <span class="hljs-keyword">let</span> filter = <span class="hljs-keyword">new</span> Dynamsoft.Utility.MultiFrameResultCrossFilter();
326
326
  filter.enableResultCrossVerification(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
327
327
  filter.enableResultDeduplication(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
328
- <span class="hljs-keyword">await</span> router.addResultFilter(filter);
328
+ <span class="hljs-keyword">await</span> cvRouter.addResultFilter(filter);
329
329
 
330
330
  <span class="hljs-keyword">await</span> cameraEnhancer.open();
331
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
331
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
332
332
  })();
333
333
  </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
334
334
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
@@ -353,29 +353,29 @@
353
353
  <ul>
354
354
  <li><p><code>Dynamsoft.License.LicenseManager.initLicense()</code>: This method initializes the license for using the SDK in the application. Note that the string "<strong>DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9</strong>" used in this example points to an online license that requires a network connection to work. Read more on <a href="#specify-the-license">Specify the license</a>.</p></li>
355
355
  <li><p><code>Dynamsoft.Core.CoreModule.loadWasm(["dbr"])</code>: This is an optional code. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding.</p></li>
356
- <li><p><code>Dynamsoft.CVR.CaptureVisionRouter.createInstance()</code>: This method creates a <code>CaptureVisionRouter</code> object <code>router</code> which controls the entire process in three steps:</p></li>
356
+ <li><p><code>Dynamsoft.CVR.CaptureVisionRouter.createInstance()</code>: This method creates a <code>CaptureVisionRouter</code> object <code>cvRouter</code> which controls the entire process in three steps:</p></li>
357
357
  <li><p><strong>Retrieve Images from the Image Source</strong></p>
358
358
  <ul>
359
- <li><code>router</code> connects to the image source through the <a href="https://www.dynamsoft.com/capture-vision/docs/core/architecture/input.html#image-source-adapter?lang=js">ImageSourceAdapter</a> interface with the method <code>setInput()</code>.<br />
359
+ <li><code>cvRouter</code> connects to the image source through the <a href="https://www.dynamsoft.com/capture-vision/docs/core/architecture/input.html#image-source-adapter?lang=js">ImageSourceAdapter</a> interface with the method <code>setInput()</code>.<br />
360
360
  <code>js
361
- router.setInput(cameraEnhancer);
361
+ cvRouter.setInput(cameraEnhancer);
362
362
  </code><br />
363
363
  &gt; The image source in our case is a <a href="https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html">CameraEnhancer</a> object created with <code>Dynamsoft.DCE.CameraEnhancer.createInstance(view)</code></li></ul></li>
364
364
  <li><p><strong>Coordinate Image-Processing Tasks</strong></p>
365
365
  <ul>
366
- <li>The coordination happens behind the scenes. <code>router</code> starts the process by specifying a preset template "ReadSingleBarcode" in the method <code>startCapturing()</code>.<br />
366
+ <li>The coordination happens behind the scenes. <code>cvRouter</code> starts the process by specifying a preset template "ReadSingleBarcode" in the method <code>startCapturing()</code>.<br />
367
367
  <code>js
368
- router.startCapturing("ReadSingleBarcode");
368
+ cvRouter.startCapturing("ReadSingleBarcode");
369
369
  </code></li></ul></li>
370
370
  <li><p><strong>Dispatch Results to Listening Objects</strong></p>
371
371
  <ul>
372
- <li>The processing results are returned through the <a href="https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js">CapturedResultReceiver</a> interface. The <code>CapturedResultReceiver</code> object is registered to <code>router</code> via the method <code>addResultReceiver()</code>. For more information, please check out <a href="#register-a-result-receiver">Register a result receiver</a>.<br />
372
+ <li>The processing results are returned through the <a href="https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js">CapturedResultReceiver</a> interface. The <code>CapturedResultReceiver</code> object is registered to <code>cvRouter</code> via the method <code>addResultReceiver()</code>. For more information, please check out <a href="#register-a-result-receiver">Register a result receiver</a>.<br />
373
373
  <code>js
374
- router.addResultReceiver({/*The-CapturedResultReceiver-Object"*/});
374
+ cvRouter.addResultReceiver({/*The-CapturedResultReceiver-Object"*/});
375
375
  </code></li>
376
- <li>Also note that reading from video is extremely fast and there could be many duplicate results. We can use a <a href="#filter-the-results-important">filter</a> with result deduplication enabled to filter out the duplicate results. The object is registered to <code>router</code> via the method <code>addResultFilter()</code>.<br />
376
+ <li>Also note that reading from video is extremely fast and there could be many duplicate results. We can use a <a href="#filter-the-results-important">filter</a> with result deduplication enabled to filter out the duplicate results. The object is registered to <code>cvRouter</code> via the method <code>addResultFilter()</code>.<br />
377
377
  <code>js
378
- router.addResultFilter(filter);
378
+ cvRouter.addResultFilter(filter);
379
379
  </code></li></ul></li>
380
380
  </ul>
381
381
  <blockquote>
@@ -408,44 +408,36 @@ router.addResultFilter(filter);
408
408
  <li><code>dce.js</code> comprises classes that offer camera support and basic user interface functionalities.</li>
409
409
  </ul>
410
410
  <p>For simplification, starting from version 10.0.21, we introduced <code>dbr.bundle.js</code>. Including this file is equivalent to incorporating all six packages.</p>
411
+ <ul>
412
+ <li>dynamsoft-core@3.2.30/dist/core.js</li>
413
+ <li>dynamsoft-license@3.2.21/dist/license.js</li>
414
+ <li>dynamsoft-utility@1.2.20/dist/utility.js</li>
415
+ <li>dynamsoft-barcode-reader@10.2.10/dist/dbr.js</li>
416
+ <li>dynamsoft-capture-vision-router@2.2.30/dist/cvr.js</li>
417
+ <li>dynamsoft-camera-enhancer@4.0.3/dist/dce.js</li>
418
+ </ul>
419
+ <p>Equivalent to</p>
420
+ <ul>
421
+ <li>dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js</li>
422
+ </ul>
423
+ <p>In the following chapters, we will use <code>dbr.bundle.js</code>.</p>
411
424
  <h4 id="use-a-public-cdn">Use a public CDN</h4>
412
425
  <p>The simplest way to include the SDK is to use either the <a href="https://jsdelivr.com/">jsDelivr</a> or <a href="https://unpkg.com/">UNPKG</a> CDN. The "hello world" example above uses <strong>jsDelivr</strong>.</p>
413
426
  <ul>
414
427
  <li>jsDelivr</li>
415
428
  </ul>
416
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.10/dist/core.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
417
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.10/dist/license.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
418
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-utility@1.2.10/dist/utility.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
419
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/dbr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
420
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.10/dist/cvr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
421
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.2/dist/dce.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
422
- </code></pre>
423
- <p>Or just</p>
424
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
429
+ <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
425
430
  </code></pre>
426
431
  <ul>
427
- <li>UNPKG </li>
432
+ <li>UNPKG</li>
428
433
  </ul>
429
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-core@3.2.10/dist/core.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
430
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-license@3.2.10/dist/license.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
431
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-utility@1.2.10/dist/utility.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
432
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-barcode-reader@10.2.10/dist/dbr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
433
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-capture-vision-router@2.2.10/dist/cvr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
434
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-camera-enhancer@4.0.2/dist/dce.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
434
+ <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
435
435
  </code></pre>
436
- <p>Or just</p>
437
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
438
- </code></pre>
439
- <p>In some rare cases (such as some restricted areas), you might not be able to access the CDN. If this happens, you can use the following files for the test.</p>
440
436
  <ul>
441
- <li>https://download2.dynamsoft.com/packages/dynamsoft-core@3.2.10/dist/core.js</li>
442
- <li>https://download2.dynamsoft.com/packages/dynamsoft-license@3.2.10/dist/license.js</li>
443
- <li>https://download2.dynamsoft.com/packages/dynamsoft-utility@1.2.10/dist/utility.js</li>
444
- <li>https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.2.10/dist/dbr.js</li>
445
- <li>https://download2.dynamsoft.com/packages/dynamsoft-capture-vision-router@2.2.10/dist/cvr.js</li>
446
- <li>https://download2.dynamsoft.com/packages/dynamsoft-camera-enhancer@4.0.2/dist/dce.js</li>
447
- <li>or bundle: https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js</li>
437
+ <li>In some rare cases (such as some restricted areas), you might not be able to access the CDN. If this happens, you can use the following files for the test.</li>
448
438
  </ul>
439
+ <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
440
+ </code></pre>
449
441
  <p>However, please <strong>DO NOT</strong> use <code>download2.dynamsoft.com</code> resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself.</p>
450
442
  <h4 id="host-the-sdk-yourself-optional">Host the SDK yourself (optional)</h4>
451
443
  <p>Besides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.</p>
@@ -455,24 +447,14 @@ router.addResultFilter(filter);
455
447
  <p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=npm&product=dbr&package=js">Download Dynamsoft Barcode Reader JavaScript Package</a></p></li>
456
448
  <li><p>npm</p></li>
457
449
  </ul>
458
- <pre><code class="hljs cmd language-cmd"> npm i dynamsoft-core@<span class="hljs-number">3</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
459
- npm i dynamsoft-license@<span class="hljs-number">3</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
460
- npm i dynamsoft-utility@<span class="hljs-number">1</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
461
- npm i dynamsoft-barcode-reader@<span class="hljs-number">10</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
462
- npm i dynamsoft-capture-vision-router@<span class="hljs-number">2</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
463
- npm i dynamsoft-camera-enhancer@<span class="hljs-number">4</span>.<span class="hljs-number">0</span>.<span class="hljs-number">2</span> -E
450
+ <pre><code class="hljs cmd language-cmd"> npm i dynamsoft-barcode-reader-bundle@<span class="hljs-number">10</span>.<span class="hljs-number">2</span>.<span class="hljs-number">1000</span> -E
464
451
  npm i dynamsoft-capture-vision-std@<span class="hljs-number">1</span>.<span class="hljs-number">2</span>.<span class="hljs-number">0</span> -E
465
452
  npm i dynamsoft-image-processing@<span class="hljs-number">2</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
466
453
  </code></pre>
467
454
  <ul>
468
455
  <li>yarn</li>
469
456
  </ul>
470
- <pre><code class="hljs cmd language-cmd"> yarn add dynamsoft-core@<span class="hljs-number">3</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
471
- yarn add dynamsoft-license@<span class="hljs-number">3</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
472
- yarn add dynamsoft-utility@<span class="hljs-number">1</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
473
- yarn add dynamsoft-barcode-reader@<span class="hljs-number">10</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
474
- yarn add dynamsoft-capture-vision-router@<span class="hljs-number">2</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
475
- yarn add dynamsoft-camera-enhancer@<span class="hljs-number">4</span>.<span class="hljs-number">0</span>.<span class="hljs-number">2</span> -E
457
+ <pre><code class="hljs cmd language-cmd"> yarn add dynamsoft-barcode-reader-bundle@<span class="hljs-number">10</span>.<span class="hljs-number">2</span>.<span class="hljs-number">1000</span> -E
476
458
  yarn add dynamsoft-capture-vision-std@<span class="hljs-number">1</span>.<span class="hljs-number">2</span>.<span class="hljs-number">0</span> -E
477
459
  yarn add dynamsoft-image-processing@<span class="hljs-number">2</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
478
460
  </code></pre>
@@ -480,28 +462,12 @@ router.addResultFilter(filter);
480
462
  <ul>
481
463
  <li>From the website</li>
482
464
  </ul>
483
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-core@3.2.10/dist/core.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
484
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-license@3.2.10/dist/license.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
485
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-utility@1.2.10/dist/utility.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
486
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-barcode-reader@10.2.10/dist/dbr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
487
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-capture-vision-router@2.2.10/dist/cvr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
488
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-camera-enhancer@4.0.2/dist/dce.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
489
- </code></pre>
490
- <p>Or just</p>
491
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
465
+ <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./dynamsoft/distributables/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
492
466
  </code></pre>
493
467
  <ul>
494
468
  <li>yarn or npm</li>
495
469
  </ul>
496
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-core/dist/core.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
497
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-license/dist/license.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
498
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-utility/dist/utility.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
499
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-barcode-reader/dist/dbr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
500
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-capture-vision-router/dist/cvr.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
501
- <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-camera-enhancer/dist/dce.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
502
- </code></pre>
503
- <p>Or just</p>
504
- <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-barcode-reader/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
470
+ <pre><code class="hljs html language-html"> <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
505
471
  </code></pre>
506
472
  <p><em>Note</em>:</p>
507
473
  <ul>
@@ -554,9 +520,9 @@ router.addResultFilter(filter);
554
520
  <p>To use the SDK, we first create a <code>CaptureVisionRouter</code> object.</p>
555
521
  <pre><code class="hljs javascript language-javascript">Dynamsoft.License.LicenseManager.initLicense(<span class="hljs-string">"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"</span>);
556
522
 
557
- <span class="hljs-keyword">let</span> router = <span class="hljs-literal">null</span>;
523
+ <span class="hljs-keyword">let</span> cvRouter = <span class="hljs-literal">null</span>;
558
524
  <span class="hljs-keyword">try</span> {
559
- router = <span class="hljs-keyword">await</span> Dynamsoft.CVR.CaptureVisionRouter.createInstance();
525
+ cvRouter = <span class="hljs-keyword">await</span> Dynamsoft.CVR.CaptureVisionRouter.createInstance();
560
526
  } <span class="hljs-keyword">catch</span> (ex) {
561
527
  <span class="hljs-built_in">console</span>.error(ex);
562
528
  }
@@ -565,26 +531,26 @@ router.addResultFilter(filter);
565
531
  <p>When creating a <code>CaptureVisionRouter</code> object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as <code>pRouter</code> in the following code:</p>
566
532
  <pre><code class="hljs javascript language-javascript">Dynamsoft.License.LicenseManager.initLicense(<span class="hljs-string">"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"</span>);
567
533
 
568
- <span class="hljs-keyword">let</span> pRouter = <span class="hljs-literal">null</span>; <span class="hljs-comment">// promise of router</span>
569
- <span class="hljs-keyword">let</span> router = <span class="hljs-literal">null</span>;
534
+ <span class="hljs-keyword">let</span> pCvRouter = <span class="hljs-literal">null</span>; <span class="hljs-comment">// promise of cvRouter</span>
535
+ <span class="hljs-keyword">let</span> cvRouter = <span class="hljs-literal">null</span>;
570
536
 
571
537
  <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'btn-scan'</span>).addEventListener(<span class="hljs-string">'click'</span>, <span class="hljs-keyword">async</span> () =&gt; {
572
538
  <span class="hljs-keyword">try</span> {
573
- router = <span class="hljs-keyword">await</span> (pRouter = pRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance());
539
+ cvRouter = <span class="hljs-keyword">await</span> (pCvRouter = pCvRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance());
574
540
  } <span class="hljs-keyword">catch</span> (ex) {
575
541
  <span class="hljs-built_in">console</span>.error(ex);
576
542
  }
577
543
  });
578
544
  </code></pre>
579
545
  <h4 id="connect-an-image-source">Connect an image source</h4>
580
- <p>The <code>CaptureVisionRouter</code> object, denoted as <code>router</code>, is responsible for handling images provided by an image source. In our scenario, we aim to detect barcodes directly from a live video stream. To facilitate this, we initialize a <code>CameraEnhancer</code> object, identified as <code>cameraEnhancer</code>, which is specifically designed to capture image frames from the video feed and subsequently forward them to <code>router</code>.</p>
546
+ <p>The <code>CaptureVisionRouter</code> object, denoted as <code>cvRouter</code>, is responsible for handling images provided by an image source. In our scenario, we aim to detect barcodes directly from a live video stream. To facilitate this, we initialize a <code>CameraEnhancer</code> object, identified as <code>cameraEnhancer</code>, which is specifically designed to capture image frames from the video feed and subsequently forward them to <code>cvRouter</code>.</p>
581
547
  <p>To enable video streaming on the webpage, we create a <code>CameraView</code> object referred to as <code>view</code>, which is then passed to <code>cameraEnhancer</code>, and its content is displayed on the webpage.</p>
582
548
  <pre><code class="hljs html language-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"cameraViewContainer"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; height: 100vh"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
583
549
  </code></pre>
584
550
  <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> view = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance();
585
551
  <span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(view);
586
552
  <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#cameraViewContainer"</span>).append(view.getUIElement());
587
- router.setInput(cameraEnhancer);
553
+ cvRouter.setInput(cameraEnhancer);
588
554
  </code></pre>
589
555
  <h4 id="register-a-result-receiver">Register a result receiver</h4>
590
556
  <p>Once the image processing is complete, the results are sent to all the registered <code>CapturedResultReceiver</code> objects. Each <code>CapturedResultReceiver</code> object may encompass one or multiple callback functions associated with various result types. In our particular case, our focus is on identifying barcodes within the images, so it's sufficient to define the callback function <code>onDecodedBarcodesReceived</code>:</p>
@@ -594,20 +560,20 @@ resultReceiver.onDecodedBarcodesReceived = <span class="hljs-function">(<span cl
594
560
  <span class="hljs-keyword">if</span> (result.barcodeResultItems.length &gt; <span class="hljs-number">0</span>) {
595
561
  resultsContainer.textContent = <span class="hljs-string">''</span>;
596
562
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> item <span class="hljs-keyword">of</span> result.barcodeResultItems) {
597
- <span class="hljs-comment">// In this example, the barcode result is shown on the page beneath the video</span>
563
+ <span class="hljs-comment">// In this example, the barcode results are displayed on the page below the video.</span>
598
564
  resultsContainer.textContent += <span class="hljs-string">`<span class="hljs-subst">${item.formatString}</span>: <span class="hljs-subst">${item.text}</span>\n\n`</span>;
599
565
  }
600
566
  }
601
567
  };
602
- router.addResultReceiver(resultReceiver);
568
+ cvRouter.addResultReceiver(resultReceiver);
603
569
  </code></pre>
604
570
  <p>You can also write code like this. It is the same.</p>
605
571
  <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>);
606
- router.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
572
+ cvRouter.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</span>: <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
607
573
  <span class="hljs-keyword">if</span> (result.barcodeResultItems.length &gt; <span class="hljs-number">0</span>) {
608
574
  resultsContainer.textContent = <span class="hljs-string">''</span>;
609
575
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> item <span class="hljs-keyword">of</span> result.barcodeResultItems) {
610
- <span class="hljs-comment">// In this example, the barcode result is shown on the page beneath the video</span>
576
+ <span class="hljs-comment">// In this example, the barcode results are displayed on the page below the video.</span>
611
577
  resultsContainer.textContent += <span class="hljs-string">`<span class="hljs-subst">${item.formatString}</span>: <span class="hljs-subst">${item.text}</span>\n\n`</span>;
612
578
  }
613
579
  }
@@ -617,15 +583,15 @@ router.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</sp
617
583
  <h4 id="start-the-process">Start the process</h4>
618
584
  <p>With the setup now complete, we can proceed to process the images in two straightforward steps:</p>
619
585
  <ol>
620
- <li>Initiate the image source to commence image acquisition. In our scenario, we invoke the <code>open()</code> method on <code>cameraEnhancer</code> to initiate video streaming and simultaneously initiate the collection of images. These collected images will be dispatched to <code>router</code> as per its request.</li>
586
+ <li>Initiate the image source to commence image acquisition. In our scenario, we invoke the <code>open()</code> method on <code>cameraEnhancer</code> to initiate video streaming and simultaneously initiate the collection of images. These collected images will be dispatched to <code>cvRouter</code> as per its request.</li>
621
587
  <li>Define a preset template to commence image processing. In our case, we utilize the "ReadSingleBarcode" template, specifically tailored for processing images containing a single barcode.</li>
622
588
  </ol>
623
589
  <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">await</span> cameraEnhancer.open();
624
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
590
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
625
591
  </code></pre>
626
592
  <p><em>Note</em>:</p>
627
593
  <ul>
628
- <li><code>router</code> is engineered to consistently request images from the image source.</li>
594
+ <li><code>cvRouter</code> is engineered to consistently request images from the image source.</li>
629
595
  <li>Various preset templates are at your disposal for barcode reading:</li>
630
596
  </ul>
631
597
  <table>
@@ -672,39 +638,36 @@ router.addResultReceiver({ <span class="hljs-attr">onDecodedBarcodesReceived</sp
672
638
  <p>When making adjustments to some basic tasks, we often only need to modify <a href="https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/interfaces/simplified-capture-vision-settings.html">SimplifiedCaptureVisionSettings</a>.</p>
673
639
  <h5 id="change-barcode-settings">Change barcode settings</h5>
674
640
  <p>The preset templates can be updated to meet different requirements. For example, the following code limits the barcode format to QR code.</p>
675
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
641
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
676
642
  settings.barcodeSettings.barcodeFormatIds =
677
643
  Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;
678
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
679
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
644
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
645
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
680
646
  </code></pre>
681
647
  <p>For a list of adjustable barcode settings, check out <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html">SimplifiedBarcodeReaderSettings</a>.</p>
682
648
  <h5 id="retrieve-the-original-image">Retrieve the original image</h5>
683
649
  <p>Additionally, we have the option to modify the template to retrieve the original image containing the barcode.</p>
684
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
650
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
685
651
  settings.capturedResultItemTypes |=
686
652
  Dynamsoft.Core.EnumCapturedResultItemType.CRIT_ORIGINAL_IMAGE;
687
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
688
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
653
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
654
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
689
655
  </code></pre>
690
656
  <p>Limit the barcode format to QR code, and retrieve the original image containing the barcode, at the same time.</p>
691
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
657
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
692
658
  settings.capturedResultItemTypes =
693
659
  Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE |
694
660
  Dynamsoft.Core.EnumCapturedResultItemType.CRIT_ORIGINAL_IMAGE;
695
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
696
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
661
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
662
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
697
663
  </code></pre>
698
664
  <p>Please be aware that it is necessary to update the <code>CapturedResultReceiver</code> object to obtain the original image. For instance:</p>
699
- <pre><code class="hljs javascript language-javascript">resultReceiver.onCapturedResultReceived = <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
700
- <span class="hljs-keyword">let</span> barcodes = result.items.filter(<span class="hljs-function">(<span class="hljs-params">item</span>) =&gt;</span>
701
- item.type === Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE
702
- );
665
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">const</span> EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType;
666
+ resultReceiver.onCapturedResultReceived = <span class="hljs-function">(<span class="hljs-params">result</span>) =&gt;</span> {
667
+ <span class="hljs-keyword">let</span> barcodes = result.items.filter(<span class="hljs-function"><span class="hljs-params">item</span> =&gt;</span> item.type === EnumCRIT.CRIT_BARCODE);
703
668
  <span class="hljs-keyword">if</span> (barcodes.length &gt; <span class="hljs-number">0</span>) {
704
669
  <span class="hljs-keyword">let</span> image = result.items.filter(
705
- <span class="hljs-function">(<span class="hljs-params">item</span>) =&gt;</span>
706
- item.type ===
707
- Dynamsoft.Core.EnumCapturedResultItemType.CRIT_ORIGINAL_IMAGE
670
+ <span class="hljs-function"><span class="hljs-params">item</span> =&gt;</span> item.type === EnumCRIT.CRIT_ORIGINAL_IMAGE
708
671
  )[<span class="hljs-number">0</span>].imageData;
709
672
  <span class="hljs-comment">// The image that we found the barcode(s) on.</span>
710
673
  }
@@ -715,14 +678,14 @@ settings.capturedResultItemTypes =
715
678
  <blockquote>
716
679
  <p>Please bear in mind that in the following code, if an image's processing time is shorter than 500 milliseconds, the SDK will wait for the full 500 milliseconds before proceeding to process the next image. Conversely, if an image's processing time exceeds 500 milliseconds, the subsequent image will be processed immediately upon completion.</p>
717
680
  </blockquote>
718
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
681
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
719
682
  settings.minImageCaptureInterval = <span class="hljs-number">500</span>;
720
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
721
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
683
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
684
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
722
685
  </code></pre>
723
686
  <h5 id="specify-a-scan-region">Specify a scan region</h5>
724
687
  <p>You can use the parameter <code>roi</code> (region of interest) together with the parameter <code>roiMeasuredInPercentage</code> to configure the SDK to only read a specific region on the image frames. For example, the following code limits the reading in the center 25%( = 50% * 50%) of the image frames:</p>
725
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
688
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
726
689
  settings.roiMeasuredInPercentage = <span class="hljs-literal">true</span>;
727
690
  settings.roi.points = [
728
691
  { <span class="hljs-attr">x</span>: <span class="hljs-number">25</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">25</span> },
@@ -730,8 +693,8 @@ settings.roi.points = [
730
693
  { <span class="hljs-attr">x</span>: <span class="hljs-number">75</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">75</span> },
731
694
  { <span class="hljs-attr">x</span>: <span class="hljs-number">25</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">75</span> },
732
695
  ];
733
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
734
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
696
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
697
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
735
698
  </code></pre>
736
699
  <p>While the code above accomplishes the task, a more effective approach is to restrict the scan region directly at the image source, as demonstrated in the following code snippet.</p>
737
700
  <blockquote>
@@ -756,10 +719,10 @@ cameraEnhancer.setScanRegion({
756
719
  You can set the maximum time allowed for processing a single image with the property `timeout`.
757
720
 
758
721
  > Please be aware that the SDK will cease processing an image if its processing time exceeds the duration specified by the `timeout` parameter. It should not be confused with the previously discussed parameter, `minImageCaptureInterval`.
759
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> router.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
722
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> settings = <span class="hljs-keyword">await</span> cvRouter.getSimplifiedSettings(<span class="hljs-string">"ReadSingleBarcode"</span>);
760
723
  settings.timeout = <span class="hljs-number">500</span>;
761
- <span class="hljs-keyword">await</span> router.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
762
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
724
+ <span class="hljs-keyword">await</span> cvRouter.updateSettings(<span class="hljs-string">"ReadSingleBarcode"</span>, settings);
725
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>);
763
726
  </code></pre>
764
727
  -->
765
728
  <h4 id="edit-the-preset-templates-directly">Edit the preset templates directly</h4>
@@ -768,15 +731,15 @@ settings.timeout = <span class="hljs-number">500</span>;
768
731
  <li>"/dynamsoft-barcode-reader-js-10.2.10/dynamsoft/resources/barcode-reader/templates/"</li>
769
732
  </ul>
770
733
  <p>Upon completing the template editing, you can invoke the <code>initSettings</code> method and provide it with the template path as an argument.</p>
771
- <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">await</span> router.initSettings(<span class="hljs-string">"PATH-TO-THE-FILE"</span>); <span class="hljs-comment">//e.g. "https://your-website/ReadSingleBarcode.json")</span>
772
- <span class="hljs-keyword">await</span> router.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>); <span class="hljs-comment">// Make sure the name matches one of the CaptureVisionTemplates in the</span>
734
+ <pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">await</span> cvRouter.initSettings(<span class="hljs-string">"PATH-TO-THE-FILE"</span>); <span class="hljs-comment">//e.g. "https://your-website/ReadSingleBarcode.json")</span>
735
+ <span class="hljs-keyword">await</span> cvRouter.startCapturing(<span class="hljs-string">"ReadSingleBarcode"</span>); <span class="hljs-comment">// Make sure the name matches one of the CaptureVisionTemplates in the json file.</span>
773
736
  </code></pre>
774
737
  <h4 id="filter-the-results-important">Filter the results (Important)</h4>
775
738
  <p>While processing video frames, it's common for the same barcode to be detected multiple times. To enhance the user experience, we can use <a href="https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/utility/multi-frame-result-cross-filter.html">MultiFrameResultCrossFilter</a> object, having two options currently at our disposal:</p>
776
739
  <h5 id="option-1-verify-results-across-multiple-frames">Option 1: Verify results across multiple frames</h5>
777
740
  <pre><code class="hljs js language-js"><span class="hljs-keyword">let</span> filter = <span class="hljs-keyword">new</span> Dynamsoft.Utility.MultiFrameResultCrossFilter();
778
741
  filter.enableResultCrossVerification(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
779
- <span class="hljs-keyword">await</span> router.addResultFilter(filter);
742
+ <span class="hljs-keyword">await</span> cvRouter.addResultFilter(filter);
780
743
  </code></pre>
781
744
  <p><em>Note</em>:</p>
782
745
  <ul>
@@ -785,7 +748,7 @@ filter.enableResultCrossVerification(<span class="hljs-string">"barcode"</span>,
785
748
  <h5 id="option-2-eliminate-redundant-results-detected-within-a-short-time-frame">Option 2: Eliminate redundant results detected within a short time frame</h5>
786
749
  <pre><code class="hljs js language-js"><span class="hljs-keyword">let</span> filter = <span class="hljs-keyword">new</span> Dynamsoft.Utility.MultiFrameResultCrossFilter();
787
750
  filter.enableResultDeduplication(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
788
- <span class="hljs-keyword">await</span> router.addResultFilter(filter);
751
+ <span class="hljs-keyword">await</span> cvRouter.addResultFilter(filter);
789
752
  </code></pre>
790
753
  <p><em>Note</em>:</p>
791
754
  <ul>
@@ -798,14 +761,14 @@ filter.enableResultDeduplication(<span class="hljs-string">"barcode"</span>, <sp
798
761
  <p>Under certain circumstances, this duration can be extended with the method <code>setDuplicateForgetTime()</code>.</p>
799
762
  <pre><code class="hljs js language-js"><span class="hljs-keyword">let</span> filter = <span class="hljs-keyword">new</span> Dynamsoft.Utility.MultiFrameResultCrossFilter();
800
763
  filter.setDuplicateForgetTime(<span class="hljs-number">5000</span>); <span class="hljs-comment">// Extend the duration to 5 seconds.</span>
801
- <span class="hljs-keyword">await</span> router.addResultFilter(filter);
764
+ <span class="hljs-keyword">await</span> cvRouter.addResultFilter(filter);
802
765
  </code></pre>
803
766
  <p>You can also enable both options at the same time:</p>
804
767
  <pre><code class="hljs js language-js"><span class="hljs-keyword">let</span> filter = <span class="hljs-keyword">new</span> Dynamsoft.Utility.MultiFrameResultCrossFilter();
805
768
  filter.enableResultCrossVerification(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
806
769
  filter.enableResultDeduplication(<span class="hljs-string">"barcode"</span>, <span class="hljs-literal">true</span>);
807
770
  filter.setDuplicateForgetTime(<span class="hljs-number">5000</span>);
808
- <span class="hljs-keyword">await</span> router.addResultFilter(filter);
771
+ <span class="hljs-keyword">await</span> cvRouter.addResultFilter(filter);
809
772
  </code></pre>
810
773
  <h4 id="add-feedback">Add feedback</h4>
811
774
  <p>When a barcode is detected within the video stream, its position is immediately displayed within the video. Furthermore, utilizing the "Dynamsoft Camera Enhancer" SDK, we can introduce feedback mechanisms, such as emitting a "beep" sound or triggering a "vibration".</p>
@@ -816,7 +779,7 @@ resultReceiver.onDecodedBarcodesReceived = <span class="hljs-function">(<span cl
816
779
  Dynamsoft.DCE.Feedback.beep();
817
780
  }
818
781
  };
819
- router.addResultReceiver(resultReceiver);
782
+ cvRouter.addResultReceiver(resultReceiver);
820
783
  </code></pre>
821
784
  <h3 id="customize-the-ui">Customize the UI</h3>
822
785
  <p>The UI is part of the auxiliary SDK "Dynamsoft Camera Enhancer", read more on how to <a href="https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html#customize-the-ui">customize the UI</a>.</p>