dynamsoft-barcode-reader-bundle 10.5.3000 → 11.0.3000-beta-202507081844
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 +17 -45
- package/README.md +17 -44
- package/dist/dbr.bundle.d.ts +32 -13
- package/dist/dbr.bundle.esm.js +11 -0
- package/dist/dbr.bundle.js +2 -2
- package/dist/dbr.bundle.mjs +2 -2
- package/dist/dbr.bundle.worker.js +11 -0
- package/dist/dynamsoft-capture-vision-bundle-ml-simd.js +1 -0
- package/dist/dynamsoft-capture-vision-bundle-ml-simd.wasm +0 -0
- package/dist/dynamsoft-capture-vision-bundle-ml.js +1 -0
- package/dist/dynamsoft-capture-vision-bundle-ml.wasm +0 -0
- package/dist/dynamsoft-capture-vision-bundle.js +1 -0
- package/dist/dynamsoft-capture-vision-bundle.wasm +0 -0
- package/dist/models/OneDDeblur.data +0 -0
- package/dist/parser-resources/AADHAAR.dcpres +1 -0
- package/dist/parser-resources/AADHAAR_Map.txt +3 -0
- package/dist/parser-resources/AAMVA_DL_ID.dcpres +1 -0
- package/dist/parser-resources/AAMVA_DL_ID_WITH_MAG_STRIPE.dcpres +1 -0
- package/dist/parser-resources/AAMVA_Map.txt +70 -0
- package/dist/parser-resources/GS1_AI.dcpres +1 -0
- package/dist/parser-resources/GS1_AI_Map.txt +643 -0
- package/dist/parser-resources/MRTD_Map.txt +255 -0
- package/dist/parser-resources/MRTD_TD1_ID.dcpres +1 -0
- package/dist/parser-resources/MRTD_TD2_FRENCH_ID.dcpres +1 -0
- package/dist/parser-resources/MRTD_TD2_ID.dcpres +1 -0
- package/dist/parser-resources/MRTD_TD2_VISA.dcpres +1 -0
- package/dist/parser-resources/MRTD_TD3_PASSPORT.dcpres +1 -0
- package/dist/parser-resources/MRTD_TD3_VISA.dcpres +1 -0
- package/dist/parser-resources/SOUTH_AFRICA_DL.dcpres +1 -0
- package/dist/parser-resources/SOUTH_AFRICA_DL_Map.txt +3 -0
- package/dist/parser-resources/VIN.dcpres +1 -0
- package/dist/parser-resources/VIN_Map.txt +150 -0
- package/dist/templates/DBR-PresetTemplates.json +1005 -0
- package/dist/{barcode-scanner.ui.xml → ui/barcode-scanner.ui.xml} +23 -13
- package/dist/ui/dls.license.dialog.html +30 -0
- package/package.json +27 -15
- package/samples.url +1 -1
- package/dist/DBR-PresetTemplates.json +0 -628
- package/dist/dbr.bundle.esm.d.ts +0 -93
- package/dist/dbr.no-content-bundle.esm.js +0 -11
- package/dist/dynamsoft-barcode-reader@10.4.31/dist/DBR-PresetTemplates.json +0 -628
- package/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.d.ts +0 -383
- package/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.esm.js +0 -11
- package/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.js +0 -11
- package/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.mjs +0 -11
- package/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.d.ts +0 -1877
- package/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.esm.js +0 -11
- package/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.js +0 -11
- package/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.mjs +0 -11
- package/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.mobile-native.ui.html +0 -222
- package/dist/dynamsoft-capture-vision-router@2.4.33/dist/cvr.d.ts +0 -663
- package/dist/dynamsoft-capture-vision-router@2.4.33/dist/cvr.esm.js +0 -2121
- package/dist/dynamsoft-capture-vision-router@2.4.33/dist/cvr.js +0 -11
- package/dist/dynamsoft-capture-vision-router@2.4.33/dist/cvr.mjs +0 -2121
- package/dist/dynamsoft-capture-vision-router@2.4.33/dist/cvr.worker.js +0 -21
- package/dist/dynamsoft-capture-vision-std@1.4.21/dist/dynamsoft-barcode-reader-bundle.js +0 -1
- package/dist/dynamsoft-capture-vision-std@1.4.21/dist/dynamsoft-barcode-reader-bundle.wasm +0 -0
- package/dist/dynamsoft-core@3.4.31/dist/core.d.ts +0 -1019
- package/dist/dynamsoft-core@3.4.31/dist/core.esm.js +0 -11
- package/dist/dynamsoft-core@3.4.31/dist/core.js +0 -11
- package/dist/dynamsoft-core@3.4.31/dist/core.mjs +0 -11
- package/dist/dynamsoft-core@3.4.31/dist/core.worker.js +0 -11
- package/dist/dynamsoft-license@3.4.31/dist/dls.license.dialog.html +0 -20
- package/dist/dynamsoft-license@3.4.31/dist/license.d.ts +0 -40
- package/dist/dynamsoft-license@3.4.31/dist/license.esm.js +0 -11
- package/dist/dynamsoft-license@3.4.31/dist/license.js +0 -11
- package/dist/dynamsoft-license@3.4.31/dist/license.mjs +0 -11
- package/dist/dynamsoft-license@3.4.31/dist/license.worker.js +0 -11
- package/dist/dynamsoft-utility@1.4.32/dist/utility.d.ts +0 -118
- package/dist/dynamsoft-utility@1.4.32/dist/utility.esm.js +0 -11
- package/dist/dynamsoft-utility@1.4.32/dist/utility.js +0 -11
- package/dist/dynamsoft-utility@1.4.32/dist/utility.mjs +0 -11
- package/dist/dynamsoft-utility@1.4.32/dist/utility.worker.js +0 -11
- /package/dist/{dynamsoft-camera-enhancer@4.1.1/dist/dce.ui.html → ui/dce.ui.xml} +0 -0
package/README.html
CHANGED
|
@@ -219,18 +219,7 @@
|
|
|
219
219
|
</head>
|
|
220
220
|
<body>
|
|
221
221
|
<div id='content'>
|
|
222
|
-
<h1 id="barcode-scanner-
|
|
223
|
-
<ul>
|
|
224
|
-
<li><a href="#barcode-scanner-javascript-edition---user-guide">Barcode Scanner JavaScript Edition - User Guide</a></li>
|
|
225
|
-
<li><a href="#license">License</a><ul>
|
|
226
|
-
<li><a href="#trial-license">Trial License</a></li>
|
|
227
|
-
<li><a href="#full-license">Full License</a></li></ul></li>
|
|
228
|
-
<li><a href="#quick-start-hello-world-example">Quick Start: Hello World Example</a><ul>
|
|
229
|
-
<li><a href="#step-1-setting-up-the-html-and-including-the-barcode-scanner">Step 1: Setting up the HTML and Including the Barcode Scanner</a></li>
|
|
230
|
-
<li><a href="#step-2-initializing-the-barcode-scanner">Step 2: Initializing the Barcode Scanner</a></li>
|
|
231
|
-
<li><a href="#step-3-launching-the-barcode-scanner">Step 3: Launching the Barcode Scanner</a></li></ul></li>
|
|
232
|
-
<li><a href="#next-steps">Next Steps</a></li>
|
|
233
|
-
</ul>
|
|
222
|
+
<h1 id="build-a-web-based-barcode-scanner-using-just-a-few-lines-of-javascript">Build a Web-Based Barcode Scanner Using Just a Few Lines of JavaScript</h1>
|
|
234
223
|
<p>This user guide provides a step-by-step walkthrough of a "Hello World" web application using the <code>BarcodeScanner</code> JavaScript Edition.</p>
|
|
235
224
|
<p>The <code>BarcodeScanner</code> class offers the following features:</p>
|
|
236
225
|
<ul>
|
|
@@ -277,16 +266,8 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
277
266
|
<h2 id="quick-start-hello-world-example">Quick Start: Hello World Example</h2>
|
|
278
267
|
<pre><code class="hljs html language-html"><span class="hljs-meta"><!DOCTYPE <span class="hljs-meta-keyword">html</span>></span>
|
|
279
268
|
<span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>></span>
|
|
280
|
-
<span class="hljs-tag"><<span class="hljs-name">head</span>></span>
|
|
281
|
-
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span> /></span>
|
|
282
|
-
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span> /></span>
|
|
283
|
-
<span class="hljs-tag"><<span class="hljs-name">title</span>></span>Dynamsoft Barcode Scanner - Hello World<span class="hljs-tag"></<span class="hljs-name">title</span>></span>
|
|
284
|
-
<span class="hljs-tag"><<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.5.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
285
|
-
<span class="hljs-tag"></<span class="hljs-name">head</span>></span>
|
|
286
|
-
|
|
287
269
|
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
|
|
288
|
-
<span class="hljs-tag"><<span class="hljs-name">
|
|
289
|
-
|
|
270
|
+
<span class="hljs-tag"><<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@11.0.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
290
271
|
<span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="javascript">
|
|
291
272
|
<span class="hljs-comment">// Initialize the Dynamsoft Barcode Scanner</span>
|
|
292
273
|
<span class="hljs-keyword">const</span> barcodeScanner = <span class="hljs-keyword">new</span> Dynamsoft.BarcodeScanner({
|
|
@@ -303,7 +284,7 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
303
284
|
<span class="hljs-tag"></<span class="hljs-name">html</span>></span>
|
|
304
285
|
</code></pre>
|
|
305
286
|
<p align="center" style="text-align:center; white-space: normal; ">
|
|
306
|
-
<a target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/
|
|
287
|
+
<a target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v11.0.30/barcode-scanner-api-samples/scan-single-barcode/hello-world.html" title="Code in Github" style="text-decoration:none;">
|
|
307
288
|
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg" alt="Code in Github" width="20" height="20" style="width:20px;height:20px;">
|
|
308
289
|
</a>
|
|
309
290
|
|
|
@@ -311,26 +292,18 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
311
292
|
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg" alt="Run via JSFiddle" width="20" height="20" style="width:20px;height:20px;" >
|
|
312
293
|
</a>
|
|
313
294
|
|
|
314
|
-
<a target="_blank" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/hello-world.html?ver=
|
|
295
|
+
<a target="_blank" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/hello-world.html?ver=11.0.30&utm_source=npm" title="Run in Dynamsoft" style="text-decoration:none;">
|
|
315
296
|
<img src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg" alt="Run in Dynamsoft" width="20" height="20" style="width:20px;height:20px;">
|
|
316
297
|
</a>
|
|
317
298
|
</p>
|
|
318
299
|
<h3 id="step-1-setting-up-the-html-and-including-the-barcode-scanner">Step 1: Setting up the HTML and Including the Barcode Scanner</h3>
|
|
319
|
-
<p>As outlined earlier, this guide will help you create a simple Hello World barcode scanning application using vanilla JavaScript. The full sample code is also available in the <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/
|
|
300
|
+
<p>As outlined earlier, this guide will help you create a simple Hello World barcode scanning application using vanilla JavaScript. The full sample code is also available in the <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v11.0.30">GitHub repository</a>.</p>
|
|
320
301
|
<p>The first step before writing the code is to include the SDK in your application. You can simply include the SDK by using the precompiled script.</p>
|
|
321
302
|
<pre><code class="hljs html language-html"><span class="hljs-meta"><!DOCTYPE <span class="hljs-meta-keyword">html</span>></span>
|
|
322
303
|
<span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>></span>
|
|
323
|
-
<span class="hljs-tag"><<span class="hljs-name">head</span>></span>
|
|
324
|
-
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span> /></span>
|
|
325
|
-
<span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span> /></span>
|
|
326
|
-
<span class="hljs-tag"><<span class="hljs-name">title</span>></span>Dynamsoft Barcode Scanner - Hello World<span class="hljs-tag"></<span class="hljs-name">title</span>></span>
|
|
327
|
-
<span class="hljs-tag"><<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.5.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
328
|
-
<span class="hljs-tag"></<span class="hljs-name">head</span>></span>
|
|
329
|
-
|
|
330
304
|
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
|
|
331
|
-
<span class="hljs-tag"><<span class="hljs-name">
|
|
305
|
+
<span class="hljs-tag"><<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@11.0.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
332
306
|
<span class="hljs-tag"></<span class="hljs-name">body</span>></span>
|
|
333
|
-
|
|
334
307
|
<span class="hljs-tag"></<span class="hljs-name">html</span>></span>
|
|
335
308
|
</code></pre>
|
|
336
309
|
<p>In this example, we include the precompiled Barcode Scanner SDK script via public CDN in the header.</p>
|
|
@@ -341,17 +314,17 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
341
314
|
<ul>
|
|
342
315
|
<li>jsDelivr</li>
|
|
343
316
|
</ul>
|
|
344
|
-
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<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@
|
|
317
|
+
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<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@11.0.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
345
318
|
</code></pre>
|
|
346
319
|
<ul>
|
|
347
320
|
<li>UNPKG</li>
|
|
348
321
|
</ul>
|
|
349
|
-
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-barcode-reader-bundle@
|
|
322
|
+
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
350
323
|
</code></pre>
|
|
351
324
|
<p>When using a framework such as <strong>React</strong>, <strong>Vue</strong> or <strong>Angular</strong>, we recommend adding the package as a dependency using a package manager such as <strong>npm</strong> or <strong>yarn</strong>:</p>
|
|
352
|
-
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@
|
|
325
|
+
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@11.0.3000
|
|
353
326
|
<span class="hljs-comment"># or</span>
|
|
354
|
-
yarn add dynamsoft-barcode-reader-bundle@
|
|
327
|
+
yarn add dynamsoft-barcode-reader-bundle@11.0.3000
|
|
355
328
|
</code></pre>
|
|
356
329
|
<p>As for package managers like <strong>npm</strong> or <strong>yarn</strong>, you likely need to specify the location of the engine files as a link to a CDN. Please see the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig">BarcodeScannerConfig API</a> for a code snippet on how to set the <code>engineResourcePaths</code>.</p>
|
|
357
330
|
<div class="multi-panel-end"></div>
|
|
@@ -360,26 +333,26 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
360
333
|
<p>Alternatively, you may choose to download the SDK and host the files on your own server or preferred CDN. This approach provides better control over versioning and availability.</p>
|
|
361
334
|
<ul>
|
|
362
335
|
<li><p>From the website</p>
|
|
363
|
-
<p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=
|
|
336
|
+
<p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=11.0.30&utm_source=npm&product=dbr&package=js">Download Dynamsoft Barcode Reader JavaScript Package</a></p>
|
|
364
337
|
<p>The resources are located at path <code>dynamsoft/distributables/</code>.</p></li>
|
|
365
338
|
<li><p>From npm</p></li>
|
|
366
339
|
</ul>
|
|
367
|
-
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@
|
|
340
|
+
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@11.0.3000
|
|
368
341
|
</code></pre>
|
|
369
|
-
<p>The resources are located at the path <code>node_modules/<pkg></code>, without <code>@<version></code>. You can copy it elsewhere and add <code>@<version></code> tag
|
|
342
|
+
<p>The resources are located at the path <code>node_modules/<pkg></code>, without <code>@<version></code>. You can copy it elsewhere and add <code>@<version></code> tag.</p>
|
|
370
343
|
<blockquote>
|
|
371
344
|
<p>[!IMPORTANT]<br />
|
|
372
345
|
Since "node<em>modules" is reserved for Node.js dependencies, and in our case the package is used only as static resources, we recommend either renaming the "node</em>modules" folder or moving the "dynamsoft-" packages to a dedicated folder for static resources in your project to facilitate self-hosting.</p>
|
|
373
346
|
</blockquote>
|
|
374
347
|
<p>You can typically include SDK like this:</p>
|
|
375
|
-
<pre><code class="hljs html language-html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"path/to/dynamsoft-barcode-reader-bundle@
|
|
348
|
+
<pre><code class="hljs html language-html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"path/to/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
376
349
|
</code></pre>
|
|
377
350
|
<div class="multi-panel-end"></div>
|
|
378
351
|
<div class="multi-panel-switching-end"></div>
|
|
379
352
|
<p>Barcode Scanner comes with a <strong>Ready-to-Use UI</strong>. When the Barcode Scanner launches, it creates a container which it populates with the <strong>Ready-to-Use UI</strong>.</p>
|
|
380
353
|
<h3 id="step-2-initializing-the-barcode-scanner">Step 2: Initializing the Barcode Scanner</h3>
|
|
381
354
|
<pre><code class="hljs js language-js"><span class="hljs-comment">// Initialize the Dynamsoft Barcode Scanner</span>
|
|
382
|
-
<span class="hljs-keyword">const</span>
|
|
355
|
+
<span class="hljs-keyword">const</span> barcodescanner = <span class="hljs-keyword">new</span> Dynamsoft.BarcodeScanner({
|
|
383
356
|
<span class="hljs-comment">// Please don't forget to replace YOUR_LICENSE_KEY_HERE</span>
|
|
384
357
|
<span class="hljs-attr">license</span>: <span class="hljs-string">"YOUR_LICENSE_KEY_HERE"</span>,
|
|
385
358
|
});
|
|
@@ -393,7 +366,6 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
393
366
|
<span class="hljs-keyword">const</span> barcodescanner = <span class="hljs-keyword">new</span> Dynamsoft.BarcodeScanner({
|
|
394
367
|
<span class="hljs-attr">license</span>: <span class="hljs-string">"YOUR_LICENSE_KEY_HERE"</span>,
|
|
395
368
|
<span class="hljs-attr">scanMode</span>: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
|
|
396
|
-
<span class="hljs-attr">showResultView</span>: <span class="hljs-literal">true</span>,
|
|
397
369
|
});
|
|
398
370
|
</code></pre>
|
|
399
371
|
<h3 id="step-3-launching-the-barcode-scanner">Step 3: Launching the Barcode Scanner</h3>
|
|
@@ -412,8 +384,8 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
|
|
|
412
384
|
<p>Now that you've implemented the basic functionality, here are some recommended next steps to further explore the capabilities of the Barcode Scanner</p>
|
|
413
385
|
<ol>
|
|
414
386
|
<li>Learn how to <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html">Customize the Barcode Scanner</a></li>
|
|
415
|
-
<li>Check out the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=
|
|
416
|
-
<li>Learn about the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html?ver=
|
|
387
|
+
<li>Check out the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=11.0.3000">Official Samples and Demo</a></li>
|
|
388
|
+
<li>Learn about the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html?ver=11.0.3000">APIs of BarcodeScanner</a></li>
|
|
417
389
|
</ol>
|
|
418
390
|
</div>
|
|
419
391
|
</body>
|
package/README.md
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
# Barcode Scanner
|
|
2
|
-
|
|
3
|
-
- [Barcode Scanner JavaScript Edition - User Guide](#barcode-scanner-javascript-edition---user-guide)
|
|
4
|
-
- [License](#license)
|
|
5
|
-
- [Trial License](#trial-license)
|
|
6
|
-
- [Full License](#full-license)
|
|
7
|
-
- [Quick Start: Hello World Example](#quick-start-hello-world-example)
|
|
8
|
-
- [Step 1: Setting up the HTML and Including the Barcode Scanner](#step-1-setting-up-the-html-and-including-the-barcode-scanner)
|
|
9
|
-
- [Step 2: Initializing the Barcode Scanner](#step-2-initializing-the-barcode-scanner)
|
|
10
|
-
- [Step 3: Launching the Barcode Scanner](#step-3-launching-the-barcode-scanner)
|
|
11
|
-
- [Next Steps](#next-steps)
|
|
1
|
+
# Build a Web-Based Barcode Scanner Using Just a Few Lines of JavaScript
|
|
12
2
|
|
|
13
3
|
This user guide provides a step-by-step walkthrough of a "Hello World" web application using the `BarcodeScanner` JavaScript Edition.
|
|
14
4
|
|
|
@@ -69,16 +59,8 @@ If you are fully satisfied with the solution and would like to move forward with
|
|
|
69
59
|
```html
|
|
70
60
|
<!DOCTYPE html>
|
|
71
61
|
<html lang="en">
|
|
72
|
-
<head>
|
|
73
|
-
<meta charset="utf-8" />
|
|
74
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
75
|
-
<title>Dynamsoft Barcode Scanner - Hello World</title>
|
|
76
|
-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000/dist/dbr.bundle.js"></script>
|
|
77
|
-
</head>
|
|
78
|
-
|
|
79
62
|
<body>
|
|
80
|
-
<
|
|
81
|
-
|
|
63
|
+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"></script>
|
|
82
64
|
<script>
|
|
83
65
|
// Initialize the Dynamsoft Barcode Scanner
|
|
84
66
|
const barcodeScanner = new Dynamsoft.BarcodeScanner({
|
|
@@ -96,7 +78,7 @@ If you are fully satisfied with the solution and would like to move forward with
|
|
|
96
78
|
```
|
|
97
79
|
|
|
98
80
|
<p align="center" style="text-align:center; white-space: normal; ">
|
|
99
|
-
<a target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/
|
|
81
|
+
<a target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v11.0.30/barcode-scanner-api-samples/scan-single-barcode/hello-world.html" title="Code in Github" style="text-decoration:none;">
|
|
100
82
|
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg" alt="Code in Github" width="20" height="20" style="width:20px;height:20px;">
|
|
101
83
|
</a>
|
|
102
84
|
|
|
@@ -104,31 +86,23 @@ If you are fully satisfied with the solution and would like to move forward with
|
|
|
104
86
|
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg" alt="Run via JSFiddle" width="20" height="20" style="width:20px;height:20px;" >
|
|
105
87
|
</a>
|
|
106
88
|
|
|
107
|
-
<a target="_blank" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/hello-world.html?ver=
|
|
89
|
+
<a target="_blank" href="https://demo.dynamsoft.com/Samples/DBR/JS/barcode-scanner-api-samples/scan-single-barcode/hello-world.html?ver=11.0.30&utm_source=npm" title="Run in Dynamsoft" style="text-decoration:none;">
|
|
108
90
|
<img src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.0.0/svgs/solid/circle-play.svg" alt="Run in Dynamsoft" width="20" height="20" style="width:20px;height:20px;">
|
|
109
91
|
</a>
|
|
110
92
|
</p>
|
|
111
93
|
|
|
112
94
|
### Step 1: Setting up the HTML and Including the Barcode Scanner
|
|
113
95
|
|
|
114
|
-
As outlined earlier, this guide will help you create a simple Hello World barcode scanning application using vanilla JavaScript. The full sample code is also available in the [GitHub repository](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/
|
|
96
|
+
As outlined earlier, this guide will help you create a simple Hello World barcode scanning application using vanilla JavaScript. The full sample code is also available in the [GitHub repository](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v11.0.30).
|
|
115
97
|
|
|
116
98
|
The first step before writing the code is to include the SDK in your application. You can simply include the SDK by using the precompiled script.
|
|
117
99
|
|
|
118
100
|
```html
|
|
119
101
|
<!DOCTYPE html>
|
|
120
102
|
<html lang="en">
|
|
121
|
-
<head>
|
|
122
|
-
<meta charset="utf-8" />
|
|
123
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
124
|
-
<title>Dynamsoft Barcode Scanner - Hello World</title>
|
|
125
|
-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000/dist/dbr.bundle.js"></script>
|
|
126
|
-
</head>
|
|
127
|
-
|
|
128
103
|
<body>
|
|
129
|
-
<
|
|
104
|
+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"></script>
|
|
130
105
|
</body>
|
|
131
|
-
|
|
132
106
|
</html>
|
|
133
107
|
```
|
|
134
108
|
|
|
@@ -144,21 +118,21 @@ The simplest way to include the SDK is to use either the [**jsDelivr**](https://
|
|
|
144
118
|
- jsDelivr
|
|
145
119
|
|
|
146
120
|
```html
|
|
147
|
-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@
|
|
121
|
+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"></script>
|
|
148
122
|
```
|
|
149
123
|
|
|
150
124
|
- UNPKG
|
|
151
125
|
|
|
152
126
|
```html
|
|
153
|
-
<script src="https://unpkg.com/dynamsoft-barcode-reader-bundle@
|
|
127
|
+
<script src="https://unpkg.com/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"></script>
|
|
154
128
|
```
|
|
155
129
|
|
|
156
130
|
When using a framework such as **React**, **Vue** or **Angular**, we recommend adding the package as a dependency using a package manager such as **npm** or **yarn**:
|
|
157
131
|
|
|
158
132
|
```sh
|
|
159
|
-
npm i dynamsoft-barcode-reader-bundle@
|
|
133
|
+
npm i dynamsoft-barcode-reader-bundle@11.0.3000
|
|
160
134
|
# or
|
|
161
|
-
yarn add dynamsoft-barcode-reader-bundle@
|
|
135
|
+
yarn add dynamsoft-barcode-reader-bundle@11.0.3000
|
|
162
136
|
```
|
|
163
137
|
|
|
164
138
|
As for package managers like **npm** or **yarn**, you likely need to specify the location of the engine files as a link to a CDN. Please see the [BarcodeScannerConfig API](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig) for a code snippet on how to set the `engineResourcePaths`.
|
|
@@ -171,17 +145,17 @@ Alternatively, you may choose to download the SDK and host the files on your own
|
|
|
171
145
|
|
|
172
146
|
- From the website
|
|
173
147
|
|
|
174
|
-
[Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=
|
|
148
|
+
[Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=11.0.30&utm_source=npm&product=dbr&package=js)
|
|
175
149
|
|
|
176
150
|
The resources are located at path `dynamsoft/distributables/`.
|
|
177
151
|
|
|
178
152
|
- From npm
|
|
179
153
|
|
|
180
154
|
```sh
|
|
181
|
-
npm i dynamsoft-barcode-reader-bundle@
|
|
155
|
+
npm i dynamsoft-barcode-reader-bundle@11.0.3000
|
|
182
156
|
```
|
|
183
157
|
|
|
184
|
-
The resources are located at the path `node_modules/<pkg>`, without `@<version>`. You can copy it elsewhere and add `@<version>` tag.
|
|
158
|
+
The resources are located at the path `node_modules/<pkg>`, without `@<version>`. You can copy it elsewhere and add `@<version>` tag.
|
|
185
159
|
|
|
186
160
|
> [!IMPORTANT]
|
|
187
161
|
> Since "node_modules" is reserved for Node.js dependencies, and in our case the package is used only as static resources, we recommend either renaming the "node_modules" folder or moving the "dynamsoft-" packages to a dedicated folder for static resources in your project to facilitate self-hosting.
|
|
@@ -189,7 +163,7 @@ Alternatively, you may choose to download the SDK and host the files on your own
|
|
|
189
163
|
You can typically include SDK like this:
|
|
190
164
|
|
|
191
165
|
```html
|
|
192
|
-
<script src="path/to/dynamsoft-barcode-reader-bundle@
|
|
166
|
+
<script src="path/to/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js"></script>
|
|
193
167
|
```
|
|
194
168
|
<div class="multi-panel-end"></div>
|
|
195
169
|
|
|
@@ -201,7 +175,7 @@ Barcode Scanner comes with a **Ready-to-Use UI**. When the Barcode Scanner launc
|
|
|
201
175
|
|
|
202
176
|
```js
|
|
203
177
|
// Initialize the Dynamsoft Barcode Scanner
|
|
204
|
-
const
|
|
178
|
+
const barcodescanner = new Dynamsoft.BarcodeScanner({
|
|
205
179
|
// Please don't forget to replace YOUR_LICENSE_KEY_HERE
|
|
206
180
|
license: "YOUR_LICENSE_KEY_HERE",
|
|
207
181
|
});
|
|
@@ -217,7 +191,6 @@ This is the **simplest** way to initialize the Barcode Scanner. The configuratio
|
|
|
217
191
|
const barcodescanner = new Dynamsoft.BarcodeScanner({
|
|
218
192
|
license: "YOUR_LICENSE_KEY_HERE",
|
|
219
193
|
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
|
|
220
|
-
showResultView: true,
|
|
221
194
|
});
|
|
222
195
|
```
|
|
223
196
|
|
|
@@ -241,5 +214,5 @@ Now that the Barcode Scanner has been initialized and configured, it is ready to
|
|
|
241
214
|
Now that you've implemented the basic functionality, here are some recommended next steps to further explore the capabilities of the Barcode Scanner
|
|
242
215
|
|
|
243
216
|
1. Learn how to [Customize the Barcode Scanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html)
|
|
244
|
-
2. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=
|
|
245
|
-
3. Learn about the [APIs of BarcodeScanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html?ver=
|
|
217
|
+
2. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=11.0.3000)
|
|
218
|
+
3. Learn about the [APIs of BarcodeScanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html?ver=11.0.3000)
|
package/dist/dbr.bundle.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { EngineResourcePaths, DSImageData } from 'dynamsoft-core';
|
|
2
2
|
import * as dynamsoftCore from 'dynamsoft-core';
|
|
3
3
|
export { dynamsoftCore as Core };
|
|
4
|
-
import { CapturedResult } from 'dynamsoft-capture-vision-router';
|
|
5
|
-
import * as dynamsoftCaptureVisionRouter from 'dynamsoft-capture-vision-router';
|
|
4
|
+
import { CaptureVisionRouter, CapturedResult } from '@dynamsoft/dynamsoft-capture-vision-router';
|
|
5
|
+
import * as dynamsoftCaptureVisionRouter from '@dynamsoft/dynamsoft-capture-vision-router';
|
|
6
6
|
export { dynamsoftCaptureVisionRouter as CVR };
|
|
7
|
-
import { EnumBarcodeFormat, BarcodeResultItem } from 'dynamsoft-barcode-reader';
|
|
8
|
-
import * as dynamsoftBarcodeReader from 'dynamsoft-barcode-reader';
|
|
7
|
+
import { EnumBarcodeFormat, BarcodeResultItem } from '@dynamsoft/dynamsoft-barcode-reader';
|
|
8
|
+
import * as dynamsoftBarcodeReader from '@dynamsoft/dynamsoft-barcode-reader';
|
|
9
9
|
export { dynamsoftBarcodeReader as DBR };
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import * as dynamsoftCameraEnhancer from 'dynamsoft-camera-enhancer';
|
|
10
|
+
import { CameraView, CameraEnhancer, DrawingItem } from '@dynamsoft/dynamsoft-camera-enhancer';
|
|
11
|
+
import * as dynamsoftCameraEnhancer from '@dynamsoft/dynamsoft-camera-enhancer';
|
|
13
12
|
export { dynamsoftCameraEnhancer as DCE };
|
|
14
|
-
import * as
|
|
13
|
+
import * as dynamsoftLicense from '@dynamsoft/dynamsoft-license';
|
|
14
|
+
export { dynamsoftLicense as License };
|
|
15
|
+
import * as dynamsoftCodeParser from '@dynamsoft/dynamsoft-code-parser';
|
|
16
|
+
export { dynamsoftCodeParser as DCP };
|
|
17
|
+
import * as dynamsoftUtility from '@dynamsoft/dynamsoft-utility';
|
|
15
18
|
export { dynamsoftUtility as Utility };
|
|
16
19
|
|
|
17
20
|
declare enum EnumScanMode {
|
|
@@ -32,6 +35,7 @@ declare enum EnumResultStatus {
|
|
|
32
35
|
RS_FAILED = 2
|
|
33
36
|
}
|
|
34
37
|
|
|
38
|
+
type CameraSwitchControlMode = "hidden" | "listAll" | "toggleFrontBack";
|
|
35
39
|
interface BarcodeScannerConfig {
|
|
36
40
|
license?: string;
|
|
37
41
|
scanMode?: EnumScanMode;
|
|
@@ -40,25 +44,40 @@ interface BarcodeScannerConfig {
|
|
|
40
44
|
engineResourcePaths?: EngineResourcePaths;
|
|
41
45
|
barcodeFormats?: Array<EnumBarcodeFormat> | EnumBarcodeFormat;
|
|
42
46
|
duplicateForgetTime?: number;
|
|
43
|
-
container?: HTMLElement | string
|
|
44
|
-
onUniqueBarcodeScanned?: (result: BarcodeResultItem) => void | Promise<void>;
|
|
47
|
+
container?: HTMLElement | string;
|
|
45
48
|
showResultView?: boolean;
|
|
46
49
|
showUploadImageButton?: boolean;
|
|
47
|
-
|
|
50
|
+
showPoweredByDynamsoft?: boolean;
|
|
48
51
|
scannerViewConfig?: ScannerViewConfig;
|
|
49
52
|
resultViewConfig?: ResultViewConfig;
|
|
50
53
|
uiPath?: string;
|
|
54
|
+
onUniqueBarcodeScanned?: (result: BarcodeResultItem) => void | Promise<void>;
|
|
55
|
+
onInitPrepare?: () => void;
|
|
56
|
+
onInitReady?: (components: {
|
|
57
|
+
cameraView: CameraView;
|
|
58
|
+
cameraEnhancer: CameraEnhancer;
|
|
59
|
+
cvRouter: CaptureVisionRouter;
|
|
60
|
+
}) => void;
|
|
61
|
+
onCameraOpen?: (components: {
|
|
62
|
+
cameraView: CameraView;
|
|
63
|
+
cameraEnhancer: CameraEnhancer;
|
|
64
|
+
cvRouter: CaptureVisionRouter;
|
|
65
|
+
}) => void;
|
|
51
66
|
}
|
|
52
67
|
interface ScannerViewConfig {
|
|
53
|
-
container?: HTMLElement | string
|
|
68
|
+
container?: HTMLElement | string;
|
|
54
69
|
showCloseButton?: boolean;
|
|
70
|
+
mirrorFrontCamera?: boolean;
|
|
71
|
+
cameraSwitchControl?: CameraSwitchControlMode;
|
|
72
|
+
showFlashButton?: boolean;
|
|
73
|
+
customHighlightForBarcode?: (result: BarcodeResultItem) => DrawingItem;
|
|
55
74
|
}
|
|
56
75
|
interface BarcodeResultViewToolbarButtonsConfig {
|
|
57
76
|
clear?: ToolbarButtonConfig;
|
|
58
77
|
done?: ToolbarButtonConfig;
|
|
59
78
|
}
|
|
60
79
|
interface ResultViewConfig {
|
|
61
|
-
container?: HTMLElement | string
|
|
80
|
+
container?: HTMLElement | string;
|
|
62
81
|
toolbarButtonsConfig?: BarcodeResultViewToolbarButtonsConfig;
|
|
63
82
|
}
|
|
64
83
|
|