Skip to content

Commit 714f996

Browse files
Merge pull request #369 from dynamsoft-docs/preview
update to internal commit 32368f41
2 parents b306f30 + 5ca5b86 commit 714f996

File tree

1 file changed

+22
-15
lines changed
  • programming/javascript/user-guide

1 file changed

+22
-15
lines changed

programming/javascript/user-guide/index.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ In this guide, you will learn step by step on how to integrate the DBR-JS SDK in
6969
**Popular Examples**
7070

7171
- 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=guide)
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/angular/?ver=10.2.10&utm_source=guide)
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=guide)
7373
- 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=guide)
7474
- 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=guide)
7575
- 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=guide)
7676
- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/hello-world/webview)
77-
- 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=guide)
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=guide)
7878
- 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=guide)
7979
- 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=guide)
8080
- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/others/debug)
@@ -260,6 +260,16 @@ The simplest way to include the SDK is to use either the [jsDelivr](https://jsde
260260
261261
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.
262262
263+
- In frameworks like React and Vue, you may want to add the package as a dependency.
264+
265+
```sh
266+
267+
# or
268+
yarn add [email protected] -E
269+
```
270+
271+
In frameworks you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
272+
263273
#### Host the SDK yourself (optional)
264274
265275
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.
@@ -270,35 +280,32 @@ Options to download the SDK:
270280
271281
[Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=guide&product=dbr&package=js){:target="_blank"}
272282
283+
The resources are located at path `dynamsoft/distributables/<pkg>@<version>`.
284+
273285
- npm
274286
275-
```cmd
287+
```sh
276288
289+
# Compared with using CDN, you need to set up more resources.
277290
278291
279292
```
280-
281-
- yarn
282-
283-
```cmd
284-
yarn add [email protected] -E
285-
yarn add [email protected] -E
286-
yarn add [email protected] -E
287-
```
293+
The resources are located at path `node_modules/<pkg>`, without `@<version>`.
288294
289295
Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this
290296
291297
- From the website
292298
293299
```html
294-
<script src="./dynamsoft/distributables/[email protected]/dist/dbr.bundle.js"></script>
300+
<script src="dynamsoft/distributables/[email protected]/dist/dbr.bundle.js"></script>
295301
```
296302
297-
- yarn or npm
303+
- From node_modules
298304
299305
```html
300-
<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>
301307
```
308+
Since `@<version>` are missing, you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
302309
303310
*Note*:
304311
@@ -380,7 +387,7 @@ try {
380387
381388
*Tip*:
382389
383-
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:
384391
385392
```javascript
386393
Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");

0 commit comments

Comments
 (0)