Skip to content

Commit a403a62

Browse files
Fix grammar and UI path issues
1 parent 7662ff8 commit a403a62

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

programming/javascript/index.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ breadcrumbText: JavaScript
1313

1414
Dynamsoft Barcode Reader (DBR) can be used in JavaScript to add barcode reading capabilities to websites running in modern browsers. It is ideal for
1515

16-
* organizations who already have sophisticated websites and do not intend to develop mobile applications for the same purposes; or
17-
* organizations whose customers have no desire to install applications for temporary usage of their services.
16+
- organizations who already have sophisticated websites and do not intend to develop mobile applications for the same purposes; or
17+
- organizations whose customers have no desire to install applications for temporary usage of their services.
1818

1919
To get a fast start, you can
2020

21-
* read the [User Guide](user-guide/barcode-scanner.html), or
22-
* try the [Samples and Demos](samples-demos/)
21+
- read the [User Guide](user-guide/barcode-scanner.html), or
22+
- try the [Samples and Demos](samples-demos/)
2323

2424
The following describes the highlights of DBR JavaScript edition (DBR-JS) version 11.x.
2525

2626
# ✨BarcodeScanner – Simplified API and Built-in UI
2727

28-
The `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+
The `BarcodeScanner` class offers 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.
2929

3030
With `BarcodeScanner`, you can:
3131

32-
- Instantiate and configure the scanner with just a few lines of code;
32+
- Instantiate and configure the scanner with just a few lines of code.
3333

34-
- Select your scanning mode and present a ready-to-use scanning interface;
34+
- Select your scanning mode and present a ready-to-use scanning interface.
3535

3636
- Focus on your application logic without worrying about camera setup, UI rendering, or lifecycle management.
3737

@@ -42,11 +42,11 @@ With `BarcodeScanner`, you can:
4242

4343
## Fast Integration
4444

45-
This [JSFiddle example](https://jsfiddle.net/DynamsoftTeam/gcqjf5r7/) demonstrates all the code needed to build a web application using `BarcodeScanner`, end users of the web page can open it in a browser, access their cameras and read barcodes directly from the video input.
45+
This [JSFiddle example](https://jsfiddle.net/DynamsoftTeam/gcqjf5r7/) demonstrates all the code needed to build a web application using `BarcodeScanner`. End users of the web page can open it in a browser, access their cameras, and read barcodes directly from the video input.
4646

4747
### Camera Control
4848

49-
Customers generally need to scan a barcode on the fly at which time there is no better input than the camera hooked to or built into the device itself. As shown in the code snippet above, the product **Dynamsoft Camera Enhancer (DCE)** is used to provide camera support. It makes use of the powerful [**MediaDevices**](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) interface (provided by the browser itself) to instantly access the video input of the camera, capture image frames and supply them to the back-end decoding engine.
49+
Customers generally need to scan a barcode on the fly at which time there is no better input than the camera hooked to or built into the device itself. As shown in the example above, the product **Dynamsoft Camera Enhancer (DCE)** is used to provide camera support. It makes use of the powerful [**MediaDevices**](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) interface (provided by the browser itself) to instantly access the video input of the camera, capture image frames and supply them to the back-end decoding engine.
5050

5151
> DBR and DCE communicate through the interface called [Image Source Adapter]({{ site.dcvb_architecture }}input.html#image-source-adapter?lang=js).
5252
@@ -74,21 +74,21 @@ The actual use environment is unpredictable. The barcode may appear distorted, i
7474

7575
DBR does a lot of preparation work to make sure the barcode is as legible as possible for the decoding engine to read. This ensures a very high accuracy. In addition, DBR achieves even higher accuracy through the following ways:
7676

77-
* DBR can verify results by comparing the results of multiple consecutive recognitions;
78-
* DBR has a confidence score for each recognition which can be used to filter unwanted results;
79-
* DBR is also able to verify the barcode result with printed text that accompanies the barcode with the help of the product **Dynamsoft Label Recognizer (DLR)**.
77+
- DBR can verify results by comparing the results of multiple consecutive recognitions;
78+
- DBR has a confidence score for each recognition which can be used to filter unwanted results;
79+
- DBR is also able to verify the barcode result with printed text that accompanies the barcode with the help of the product **Dynamsoft Label Recognizer (DLR)**.
8080

81-
Through many experiences, DBR has also cultivated its error correction ability to handle
81+
Through extensive real-world use, DBR has also cultivated its error correction ability to handle:
8282

83-
* Non-standard barcodes which do not strictly abide by the specification;
84-
* Deformed barcodes which are usually caused by improper printing.
83+
- Non-standard barcodes which do not strictly abide by the specification;
84+
- Deformed barcodes which are usually caused by improper printing.
8585

8686
## Effortless Expansion
8787

8888
DBR-JS v11.x is based on [Dynamsoft Capture Vision]({{site.dcvb_architecture}}) which is a modular architecture. This architecture makes it easy to add new functionality or custom behavior with very little change to the code. Two examples are:
8989

90-
* Add **Dynamsoft Document Normalizer (DDN)** to do perspective correction before pass an image frame to read barcodes;
91-
* Add **Dynamsoft Code Parser (DCP)** to parse the text embedded in the PDF417 on driver's licenses.
90+
- Add **Dynamsoft Document Normalizer (DDN)** to do perspective correction before passing an image frame to read barcodes;
91+
- Add **Dynamsoft Code Parser (DCP)** to parse the text embedded in the PDF417 on driver's licenses.
9292

9393
## Next Step
9494

programming/javascript/user-guide/barcode-scanner-customization.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: Dynamsoft Barcode Scanner customization
1212

1313
- [Specify the barcode format](#specify-the-barcode-format)
1414
- [Use customized template](#use-customized-template)
15-
- [Config the pre-built UIs](#config-the-pre-built-uis)
15+
- [Configure the pre-built UIs](#configure-the-pre-built-uis)
1616
- [Use BarcodeScanner in frameworks](#use-barcodescanner-in-frameworks)
1717

1818
## Specify the barcode format
@@ -49,7 +49,7 @@ The benefit of this approach is that the template file can be reused across diff
4949
Refer to [`Use customized template`](#use-customized-template) for more details.
5050

5151
> [!IMPORTANT]
52-
> Due to the powerful customization capabilities, the number of configurable parameters in the templates is extensive and relatively complex. feel free to [contact us](https://www.dynamsoft.com/contact/) if you need help creating a custom template.
52+
> Due to the powerful customization capabilities, the number of configurable parameters in the templates is extensive and relatively complex. Feel free to [contact us](https://www.dynamsoft.com/contact/) if you need help creating a custom template.
5353
5454
## Use customized template
5555

@@ -61,13 +61,13 @@ In more complex scenarios—such as blurred, damaged, curved, or unevenly lit ba
6161
```js
6262
const barcodeScannerConfig = {
6363
// The path to your custom JSON template that defines the scanning process.
64-
templateFilePath:'path/to/DBR-PresetTemplates.json'
64+
templateFilePath: 'path/to/DBR-PresetTemplates.json'
6565
};
6666
// Initialize the BarcodeScanner with the above BarcodeScannerConfig object
6767
const barcodeScanner = new Dynamsoft.BarcodeScanner(barcodeScannerConfig);
6868
```
6969

70-
## Config the Pre-built UIs
70+
## Configure the Pre-built UIs
7171

7272
The built-in UI of `BarcodeScanner` is composed of `BarcodeScannerView` and `BarcodeResultView`. In `MULTI_UNIQUE` mode, `BarcodeResultView` is shown by default to ensure the essential workflow can proceed. Other UI components can be shown or hidden manually through `barcodeScannerConfig`. Let's break down these two Views:
7373

@@ -81,7 +81,7 @@ The `BarcodeScannerView` is composed of the following UI elements:
8181

8282
2. **Load Image Button**: This button allows the user to scan a file of a barcode-containing image from the device's local storage. You can decide whether to show or hide the button by [showUploadImageButton]({{ site.js_api }}barcode-scanner.html#barcodescannerconfig) property.
8383

84-
3. **Close Scanner Button**: This button closes the Barcode Scanner, return a [`BarcodeScanResult`]({{ site.js_api }}barcode-scanner.html#barcodescanresult) object and destroys the **`BarcodeScanner`** instance. You can decide whether to show or hide the button by [showCloseButton]({{ site.js_api }}barcode-scanner.html#scannerviewconfig) property.
84+
3. **Close Scanner Button**: This button closes the Barcode Scanner, returns a [`BarcodeScanResult`]({{ site.js_api }}barcode-scanner.html#barcodescanresult) object and destroys the **`BarcodeScanner`** instance. You can decide whether to show or hide the button by [showCloseButton]({{ site.js_api }}barcode-scanner.html#scannerviewconfig) property.
8585

8686
4. **Flash Button**: This button allows the user to toggle the camera's torch. You can decide whether to show or hide the button by [showFlashButton]({{ site.js_api }}barcode-scanner.html#barcodescannerconfig) property.
8787

@@ -97,11 +97,11 @@ Here is a quick breakdown of the `MULTI_UNIQUE` UI elements of the `BarcodeResul
9797

9898
2. **Clear Button**: The button on the bottom left, which clears all elements of the current `Barcode Results List`. You can change the style of the Button with [BarcodeResultViewToolbarButtonsConfig]({{ site.js_api }}barcode-scanner.html#barcoderesultviewtoolbarbuttonsconfig).
9999

100-
3. **Done Button**: The button on the bottom right, which closes the Barcode Scanner, return a [`BarcodeScanResult`]({{ site.js_api }}barcode-scanner.html#barcodescanresult) object that includes all unique barcodes and destroys the **`BarcodeScanner`** instance. You can change the style of the Button with [BarcodeResultViewToolbarButtonsConfig]({{ site.js_api }}barcode-scanner.html#barcoderesultviewtoolbarbuttonsconfig).
100+
3. **Done Button**: The button on the bottom right, which closes the Barcode Scanner, returns a [`BarcodeScanResult`]({{ site.js_api }}barcode-scanner.html#barcodescanresult) object that includes all unique barcodes and destroys the **`BarcodeScanner`** instance. You can change the style of the Button with [BarcodeResultViewToolbarButtonsConfig]({{ site.js_api }}barcode-scanner.html#barcoderesultviewtoolbarbuttonsconfig).
101101

102102
### Manually modify the UI file
103103

104-
Another way to fully customize the UI is by directly editing the `.xml` file. In the `dist/` directory, you'll find the `barcode-scanner.ui.xml` file, which is the default UI for the `BarcodeScanner`.
104+
Another way to fully customize the UI is by directly editing the `.xml` file. In the `dist/ui/` directory, you'll find the `barcode-scanner.ui.xml` file, which is the default UI for the `BarcodeScanner`.
105105

106106
> [!NOTE]
107107
> Although it is essentially HTML, using a .xml extension can help prevent compatibility issues with the Live Server plugin.
@@ -164,10 +164,10 @@ Below is an example using the official CDN — feel free to replace it with your
164164
// Configures the paths where the .wasm files and other necessary resources for modules are located.
165165
engineResourcePaths: {
166166
// Using jsDelivr CDN as an example
167-
rootDirectory: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.6000/dist/",
167+
rootDirectory: "https://cdn.jsdelivr.net/npm/",
168168
},
169169
// Path to the UI (.xml template file).
170-
uiPath: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.6000/dist/barcode-scanner.ui.xml",
170+
uiPath: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.6000/dist/ui/barcode-scanner.ui.xml",
171171
};
172172
```
173173

programming/javascript/user-guide/barcode-scanner.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The first step before writing the code is to include the SDK in your application
115115
</html>
116116
```
117117

118-
In this example, we include the precompiled Barcode Scanner SDK script via public CDN in the header.
118+
In this example, we include the precompiled Barcode Scanner SDK script via public CDN in the body.
119119

120120
<div class="multi-panel-switching-prefix"></div>
121121

@@ -144,7 +144,7 @@ When using a framework such as **React**, **Vue** or **Angular**, we recommend a
144144
yarn add dynamsoft-barcode-reader-bundle@11.0.6000
145145
```
146146

147-
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`.
147+
When using 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`.
148148
<div class="multi-panel-end"></div>
149149

150150
<div class="multi-panel-start"></div>
@@ -169,7 +169,7 @@ Alternatively, you may choose to download the SDK and host the files on your own
169169
> [!IMPORTANT]
170170
> 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.
171171
172-
You can typically include SDK like this:
172+
You can typically include the SDK like this:
173173

174174
```html
175175
<script src="path/to/dynamsoft-barcode-reader-bundle@11.0.6000/dist/dbr.bundle.js"></script>
@@ -184,9 +184,9 @@ Barcode Scanner comes with a **Ready-to-Use UI**. When the Barcode Scanner launc
184184

185185
```js
186186
// Initialize the Dynamsoft Barcode Scanner
187-
const barcodescanner = new Dynamsoft.BarcodeScanner({
187+
const barcodeScanner = new Dynamsoft.BarcodeScanner({
188188
// Please don't forget to replace YOUR_LICENSE_KEY_HERE
189-
license: "YOUR_LICENSE_KEY_HERE",
189+
license: "YOUR_LICENSE_KEY_HERE",
190190
});
191191
```
192192

@@ -197,7 +197,7 @@ This is the **simplest** way to initialize the Barcode Scanner. The configuratio
197197
198198
```js
199199
// Initialize the Dynamsoft Barcode Scanner in MULTI_UNIQUE mode
200-
const barcodescanner = new Dynamsoft.BarcodeScanner({
200+
const barcodeScanner = new Dynamsoft.BarcodeScanner({
201201
license: "YOUR_LICENSE_KEY_HERE",
202202
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
203203
});
@@ -208,7 +208,7 @@ const barcodescanner = new Dynamsoft.BarcodeScanner({
208208
```js
209209
(async () => {
210210
// Launch the scanner and wait for the result
211-
const result = await barcodescanner.launch();
211+
const result = await barcodeScanner.launch();
212212
// Display the first detected barcode's text in an alert
213213
if (result.barcodeResults.length) {
214214
alert(result.barcodeResults[0].text);
@@ -219,11 +219,11 @@ const barcodescanner = new Dynamsoft.BarcodeScanner({
219219
Now that the Barcode Scanner has been initialized and configured, it is ready to be launched! Upon launch, the Barcode Scanner presents the main **`BarcodeScannerView`** UI in its container on the page, and is ready to start scanning. By default, we use the `SINGLE` scanning mode, which means only one decoding result will be included in the final result. In the code above, we directly alerted the successfully decoded barcode text on the page.
220220

221221
> [!NOTE]
222-
> In the Hello World sample, after a successfully decoding process, the scanner closes and the user is met with an empty page. In order to open the scanner again, the user must refresh the page. You may choose to implement a more user-friendly behavior in a production environment, such as presenting the user with an option to re-open the Barcode Scanner upon closing it.
222+
> In the Hello World sample, after a successful decoding process, the scanner closes and the user is met with an empty page. In order to open the scanner again, the user must refresh the page. You may choose to implement a more user-friendly behavior in a production environment, such as presenting the user with an option to re-open the Barcode Scanner upon closing it.
223223
224224
## Next Steps
225225

226-
Now that you've implemented the basic functionality, here are some recommended next steps to further explore the capabilities of the Barcode Scanner
226+
Now that you've implemented the basic functionality, here are some recommended next steps to further explore the capabilities of the Barcode Scanner:
227227

228228
1. Learn how to [Customize the Barcode Scanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html)
229229
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.6000)

0 commit comments

Comments
 (0)