Skip to content

Commit 7ff44c5

Browse files
authored
Merge branch 'main' into preview
2 parents 48e3dbe + 4ef977a commit 7ff44c5

10 files changed

+46
-42
lines changed

programming-old/javascript/samples-demos/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ permalink: /programming/javascript/samples-demos/index.html
2727
</div>
2828
<div class="file"><a data-balloon-length="xlarge" data-balloon-pos="down" aria-label="Decode barcodes
2929
using images that are stored locally,
30-
whether on mobile or desktop." class="button title" target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/hello-world/hello-world.html">Read
30+
whether on mobile or desktop." class="button title" target="_blank" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/hello-world/read-an-image.html">Read
3131
an Existing Image</a></div>
3232
<div class="file"><a data-balloon-length="xlarge" data-balloon-pos="down" aria-label="Decode video stream in an Angular
3333
Application from a USB-connected or built-in camera (mobile or desktop)." class="button title"

programming/javascript/faq/add-remove-beep-sound.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ Dynamsoft.DCE.Feedback.beep();
1919
**_NOTE:_** - Check the class [Feedback](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/api-reference/feedback.html#beep) for more details.
2020

2121

22-
<details>
23-
<summary><b> Version 9</b></summary>
22+
## Version 9
2423
This feature is controlled using the [whenToPlaySoundforSuccessfulRead](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interface/ScanSettings.html?ver=latest) property. To enable the feature, set the property to either **frame** or **unique**. To disable the feature, set it to **never**.
2524

2625
> This feature is disabled by default.
27-
</details>

programming/javascript/faq/difference-between-barcodeReader-and-barcodeScanner.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ needAutoGenerateSidebar: false
99
# What is the difference between the BarcodeReader class and the BarcodeScanner class? Can they be used interchangeably?
1010

1111
[<< Back to FAQ index](index.md)
12+
1213
**_NOTE:_** - This is for version 9 or lower of barcode reader sdk
1314
No, as each offers a different functionality than the other. The `BarcodeReader` class is used to decode static images (via one of the [decode\*](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/BarcodeReader.html#decode-barcodes) methods) and does not have the ability to open the camera stream and decode barcodes directly from the video stream.
1415

programming/javascript/faq/difference-between-bestspeed-and-bestcoverage.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ needAutoGenerateSidebar: false
1010

1111
[<< Back to FAQ index](index.md)
1212

13-
`speed`, as the name suggests, prioritizes time cost over the accuracy of the results, and `coverage` is vice versa.
13+
`SpeedFirst`, as the name suggests, prioritizes time cost over the accuracy of the results, and `ReadRateFirst` is vice versa.
1414

15-
`balance` is the perfect middle ground between `speed` and `coverage`.
15+
`Balance` is the perfect middle ground between `SpeedFirst` and `ReadRateFirst`.
1616

17-
Lastly, the `single` template is optimized for interactive video scenarios, and is the default mode when using the `BarcodeScanner` class.
17+
Lastly, the `Single` template is optimized for interactive video scenarios, and is the default mode.
18+
19+
To choose the proper template that you want the SDK to utilize and learn about some of the other templates we offer, please use the [PresetTemplate](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/preset-templates.html?product=dbr&lang=javascript).
1820

1921
In terms of the individual settings, if you would like to learn of the exact breakdown between the different templates, please contact the [Dynamsoft support team](https://www.dynamsoft.com/contact/).
2022

21-
To choose the runtime settings template that you want the SDK to utilize and learn about some of the other templates we offer, please use the [updateRuntimeSettings](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeReader.html#updateruntimesettings) method.

programming/javascript/faq/differences-between-updateScanSettings-updateVideoSettings-and-updateRuntimeSettings.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ needAutoGenerateSidebar: false
1010

1111
[<< Back to FAQ index](index.md)
1212

13+
## Version 10
14+
`updateVideoSettings` is used to update the [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Constraints) that define most of the video information such as width, height, and the camera facingMode (i.e. front or rear camera).
15+
16+
`updateSettings` is used to update the [SimplifiedSettings](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/interfaces/simplified-capture-vision-settings.html?product=dbr&lang=javascript) interface. It updates the runtime settings with a given template object.
17+
```javascript
18+
let settings = await router.getSimplifiedSettings("ReadSingleBarcode");
19+
settings.barcodeSettings.barcodeFormatIds =
20+
Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE;
21+
await router.updateSettings("ReadSingleBarcode", settings);
22+
await router.startCapturing("ReadSingleBarcode");
23+
```
24+
25+
## Version 9
26+
1327
`updateScanSettings` is used to update the [ScanSettings](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/interface/ScanSettings.html?ver=latest) interface. This can be used to configure settings such as ignoring duplicate reads, setting sound/vibration when a barcode is scanned.
1428

1529
`updateVideoSettings` is used to update the [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Constraints) that define most of the video information such as width, height, and the camera facingMode (i.e. front or rear camera).

programming/javascript/faq/read-from-existing-files.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@ needAutoGenerateSidebar: false
1010

1111
[<< Back to FAQ index](index.md)
1212

13-
Yes, the JavaScript SDK supports reading from a file in local memory. This can be achieved via the `BarcodeReader` class instead of the `BarcodeScanner` class.
13+
Yes, the JavaScript SDK supports reading from a file in local memory.
1414

15+
## Version 10.x
16+
```javascript
17+
let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
18+
// Use the router to perform a job.
19+
let results = await router.capture("blob:https://demo.dynamsoft.com/afb84bd2-e8cb-4b96-92b6-36dc89783692", "ReadSingleBarcode");
20+
// ...
21+
// Release the resources after the job is finished.
22+
router.dispose();
23+
```
24+
25+
## Version 9.x
1526
```javascript
1627
let reader = await Dynamsoft.DBR.BarcodeReader.createInstance();
1728
let results = await reader.decode(imageSource);

programming/javascript/faq/scan-US-drivers-license.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ needAutoGenerateSidebar: false
1010

1111
[<< Back to FAQ index](index.md)
1212

13-
You can scan a US driver's license to get all of these details using our SDK. The best way to do so is to follow our pre-built driver license sample for the JavaScript edition, which can be found in the [code gallery](https://www.dynamsoft.com/barcode-reader/resources/code-gallery/?SampleID=619). This sample can also be found in the `samples\4.use-case` folder of the JavaScript package download (via the Dynamsoft [free trial download](https://www.dynamsoft.com/barcode-reader/downloads)).
13+
You can scan a US driver's license to get all of these details using our SDK. The best way to do so is to follow our pre-built driver license sample for the JavaScript edition, which can be found in the [code gallery](https://github.com/Dynamsoft/barcode-reader-javascript-demo). This sample can also be found in the `samples\4.use-case` folder of the JavaScript package download (via the Dynamsoft [free trial download](https://www.dynamsoft.com/barcode-reader/downloads)).

programming/javascript/faq/server-requirements-for-dbr-js-deployment.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

programming/javascript/faq/unable-to-scan-aztec-code.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ needAutoGenerateSidebar: false
99
# Why am I unable to scan an Aztec code in the helloworld sample?
1010

1111
[<< Back to FAQ index](index.md)
12+
# Version 10
13+
```javascript
14+
let settings = await router.getSimplifiedSettings("ReadSingleBarcode");
15+
settings.barcodeSettings.barcodeFormatIds =
16+
Dynamsoft.DBR.EnumBarcodeFormat.BF_AZTEC;
17+
await router.updateSettings("ReadSingleBarcode", settings);
18+
await router.startCapturing("ReadSingleBarcode");
19+
```
1220

1321
## For version 8 and version 9
1422

programming/javascript/user-guide/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ The complete code of the "Hello World" example is shown below
164164
165165
#### About the code
166166
167-
- `Dynamsoft.License.LicenseManager.initLicense()`: This method initializes the license for using the SDK in the application. Note that the string "**DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9**" used in this example points to an online license that requires a network connection to work. Read more on [Specify the license](#specify-the-license).
167+
- `Dynamsoft.License.LicenseManager.initLicense()`: This method initializes the license for using the SDK in the application. Note that the string "**DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9**" used in this example points to an online license that requires a network connection to work. Read more on [Specify the license](#1-specify-the-license).
168168
169169
- `Dynamsoft.Core.CoreModule.loadWasm(["dbr"])`: This is an optional code. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding.
170170
@@ -181,11 +181,11 @@ The complete code of the "Hello World" example is shown below
181181
cvRouter.startCapturing("ReadSingleBarcode");
182182
```
183183
- **Dispatch Results to Listening Objects**
184-
- The processing results are returned through the [CapturedResultReceiver](https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js) interface. The `CapturedResultReceiver` object is registered to `cvRouter` via the method `addResultReceiver()`. For more information, please check out [Register a result receiver](#register-a-result-receiver).
184+
- The processing results are returned through the [CapturedResultReceiver](https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js) interface. The `CapturedResultReceiver` object is registered to `cvRouter` via the method `addResultReceiver()`. For more information, please check out [Register a result receiver](#step-4-register-a-result-receiver).
185185
```js
186186
cvRouter.addResultReceiver({/*The-CapturedResultReceiver-Object"*/});
187187
```
188-
- Also note that reading from video is extremely fast and there could be many duplicate results. We can use a [filter](#filter-the-results-important) with result deduplication enabled to filter out the duplicate results. The object is registered to `cvRouter` via the method `addResultFilter()`.
188+
- Also note that reading from video is extremely fast and there could be many duplicate results. We can use a [filter](#3-important-filter-the-results) with result deduplication enabled to filter out the duplicate results. The object is registered to `cvRouter` via the method `addResultFilter()`.
189189
```js
190190
cvRouter.addResultFilter(filter);
191191
```

0 commit comments

Comments
 (0)