Skip to content

Commit 12965da

Browse files
authored
Update README.md
Update README.md
2 parents 6928990 + af8198f commit 12965da

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed

README.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
---
2+
layout: default-layout
3+
title: v10.2.10 User Guide - Dynamsoft Barcode Reader JavaScript Edition
4+
description: This is the user guide of Dynamsoft Barcode Reader JavaScript SDK.
5+
keywords: user guide, javascript, js
6+
breadcrumbText: User Guide
7+
noTitleIndex: true
8+
needGenerateH3Content: true
9+
needAutoGenerateSidebar: true
10+
schema: schemas/dynamsoft-facilitates-mit-research-schema.json
11+
---
12+
13+
<!--The original doc is hosted here => https://github.com/dynamsoft-docs/barcode-reader-docs-js/blob/main/programming/javascript/user-guide/index.md -->
14+
115
# Barcode Reader for Your Website - User Guide
216

317
[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.
@@ -55,12 +69,12 @@ In this guide, you will learn step by step on how to integrate the DBR-JS SDK in
5569
**Popular Examples**
5670

5771
- Hello World - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/hello-world.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=github)
58-
- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/angular/?ver=10.2.10&utm_source=github)
72+
- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/dbrjs-sample-angular/browser/?ver=10.2.10&utm_source=github)
5973
- React App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/react) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.2.10&utm_source=github)
6074
- Vue App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/vue) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.2.10&utm_source=github)
6175
- PWA App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/pwa) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.2.10&utm_source=github)
6276
- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/hello-world/webview)
63-
- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?ver=10.2.10&utm_source=github)
77+
- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license/index.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license/index.html?ver=10.2.10&utm_source=github)
6478
- Fill A Form - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/fill-a-form-with-barcode-reading.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?ver=10.2.10&utm_source=github)
6579
- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/show-result-texts-on-the-video.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/use-case/show-result-texts-on-the-video.html?ver=10.2.10&utm_source=github)
6680
- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/others/debug)
@@ -246,6 +260,16 @@ The simplest way to include the SDK is to use either the [jsDelivr](https://jsde
246260
247261
However, please **DO NOT** use `download2.dynamsoft.com` resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself.
248262
263+
- In frameworks like React and Vue, you may want to add the package as a dependency.
264+
265+
```sh
266+
npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
267+
# or
268+
yarn add dynamsoft-barcode-reader-bundle@10.2.1000 -E
269+
```
270+
271+
In frameworks you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
272+
249273
#### Host the SDK yourself (optional)
250274
251275
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.
@@ -256,35 +280,32 @@ Options to download the SDK:
256280
257281
[Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=github&product=dbr&package=js)
258282
283+
The resources are located at path `dynamsoft/distributables/<pkg>@<version>`.
284+
259285
- npm
260286
261-
```cmd
287+
```sh
262288
npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
289+
# Compared with using CDN, you need to set up more resources.
263290
npm i dynamsoft-capture-vision-std@1.2.0 -E
264291
npm i dynamsoft-image-processing@2.2.10 -E
265292
```
266-
267-
- yarn
268-
269-
```cmd
270-
yarn add dynamsoft-barcode-reader-bundle@10.2.1000 -E
271-
yarn add dynamsoft-capture-vision-std@1.2.0 -E
272-
yarn add dynamsoft-image-processing@2.2.10 -E
273-
```
293+
The resources are located at path `node_modules/<pkg>`, without `@<version>`.
274294
275295
Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this
276296
277297
- From the website
278298
279299
```html
280-
<script src="./dynamsoft/distributables/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
300+
<script src="dynamsoft/distributables/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
281301
```
282302
283-
- yarn or npm
303+
- From node_modules
284304
285305
```html
286-
<script src="/node_modules/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
306+
<script src="node_modules/dynamsoft-barcode-reader-bundle/dist/dbr.bundle.js"></script>
287307
```
308+
Since `@<version>` are missing, you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
288309
289310
*Note*:
290311
@@ -328,13 +349,13 @@ The purpose is to tell the SDK where to find the engine files (\*.worker.js, \*.
328349
```javascript
329350
//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files
330351
Object.assign(Dynamsoft.Core.CoreModule.engineResourcePaths, {
331-
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.0/dist/",
332-
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.10/dist/",
333-
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.10/dist/",
334-
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.10/dist/",
335-
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.10/dist/",
352+
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.10/dist/",
353+
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.30/dist/",
354+
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.30/dist/",
355+
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.21/dist/",
356+
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.30/dist/",
336357
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/",
337-
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.2/dist/"
358+
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.3/dist/"
338359
});
339360
```
340361
@@ -366,7 +387,7 @@ try {
366387
367388
*Tip*:
368389
369-
When creating a `CaptureVisionRouter` 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 `pRouter` in the following code:
390+
When creating a `CaptureVisionRouter` 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 `pCvRouter` in the following code:
370391
371392
```javascript
372393
Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");

0 commit comments

Comments
 (0)