You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: programming/javascript/api-reference/barcode-scanner.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@ noTitleIndex: true
11
11
12
12
# Barcode Scanner JavaScript Edition API Reference
13
13
14
-
## Class: BarcodeScanner
14
+
BarcodeScanner is a configurable barcode scanning module featuring a pre-built UI that supports both live camera and still image decoding. Designed for effortless integration into web applications, it offers a ready-to-use, customizable interface to streamline barcode scanning implementation.
15
15
16
-
A configurable barcode scanning module featuring a pre-built UI that supports both live camera and still image decoding. Designed for effortless integration into web applications, it offers a ready-to-use, customizable interface to streamline barcode scanning implementation.
16
+
## Constructor
17
17
18
-
### Constructor
18
+
### BarcodeScanner
19
19
20
20
```ts
21
21
newBarcodeScanner(config?:BarcodeScannerConfig)
@@ -40,9 +40,9 @@ const barcodeScanner = new Dynamsoft.BarcodeScanner({
40
40
});
41
41
```
42
42
43
-
### Method
43
+
##Methods
44
44
45
-
####launch()
45
+
### launch()
46
46
47
47
Launches the scanner and optionally renders the scanning UI based on scanMode and container configuration.
48
48
@@ -68,7 +68,22 @@ A promise that resolves to a [`BarcodeScanResult`](#barcodescanresult).
68
68
})();
69
69
```
70
70
71
-
#### decode()
71
+
### dispose()
72
+
73
+
Disposes the scanner instance and cleans up all related resources.
74
+
75
+
```ts
76
+
dispose(): void
77
+
```
78
+
79
+
**Code Snippet**
80
+
81
+
```js
82
+
barcodeScanner.dispose();
83
+
console.log("Scanner resources released.");
84
+
```
85
+
86
+
### decode()
72
87
73
88
Decodes a barcode from an image, URL, or canvas element.
|`engineResourcePaths`(optional) |`EngineResourcePaths`|`N/A`| Paths to engine resources like WASM or workers. See [EngineResourcePaths](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module-class.html?product=dbr&lang=javascript#engineresourcepaths) for details. |
145
145
|`uiPath` (optional) |`string`|`N/A`| Path to the custom UI (`.xml` template file) for the ScannerView.|
146
-
|`barcodeFormats`(optional) |`Array<EnumBarcodeFormat>`|`N/A`|An array of [EnumBarcodeFormat](https://www.dynamsoft.com/capture-vision/docs/core/enums/barcode-reader/barcode-format.html?lang=js&product=dbr) specifying the formats to recognize. |
146
+
|`barcodeFormats`(optional) |`EnumBarcodeFormat`\|`Array<EnumBarcodeFormat>`|`N/A`|[EnumBarcodeFormat](https://www.dynamsoft.com/capture-vision/docs/core/enums/barcode-reader/barcode-format.html?lang=js&product=dbr) or an array of `EnumBarcodeFormat` specifying the formats to recognize. |
147
147
|`duplicateForgetTime`(optional) |`number`|`3000`| Time interval in milliseconds before duplicate barcodes can be reported again. |
148
148
|`removePoweredByMessage`(optional) |`boolean`|`false`| Whether to remove the "powered by" message. |
149
149
|`container`(optional) |`HTMLElement`\|`string`|`N/A`| A container element or selector for rendering the scanner and/or result view. |
// The path to your custom JSON template that defines the scanning process.
169
169
templateFilePath:'./DBR-PresetTemplates.json',
170
170
// engineResourcePaths typically is only assigned when using a framework like React/Angular/Vue where the resources are not in the same location as the script reference.
Copy file name to clipboardExpand all lines: programming/javascript/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,9 @@ To get a fast start, you can
23
23
24
24
The following describes the highlights of DBR JavaScript edition (DBR-JS) version 10.x.
25
25
26
-
## New in v10.5.1000: BarcodeScanner – Simplified API and Built-in UI
26
+
## New in v10.5.3000: BarcodeScanner – Simplified API and Built-in UI
27
27
28
-
Version 10.5.1000 introduces the all-new `BarcodeScanner` class, offering a streamlined API and a prebuilt interactive UI, making barcode scanning integration easier than ever. This is now the recommended way to use DBR-JS, especially for developers who want a quick, clean, and robust scanning experience with minimal setup.
28
+
Version 10.5.3000 introduces the all-new `BarcodeScanner` class, offering a streamlined API and a prebuilt interactive UI, making barcode scanning integration easier than ever. This is now the recommended way to use DBR-JS, especially for developers who want a quick, clean, and robust scanning experience with minimal setup.
0 commit comments