Skip to content

Commit 7d65c3c

Browse files
docs: update README with sample list and descriptions; add comments to hello-world example
1 parent 2261ffc commit 7d65c3c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ If you have any questions, feel free to [contact Dynamsoft support](https://www.
3939

4040
## Sample list
4141

42+
### Hello-world
43+
44+
- [hello-world.html](./hello-world.html) — The simplest example to get started with single barcode scanning.
45+
- [read-an-image.html](./read-an-image.html) — Demonstrates how to decode and read barcodes from uploaded image files.
46+
4247
### Frameworks
4348

4449
- [angular/](./frameworks/angular/) — Angular examples.

hello-world.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ <h1 class="barcode-scanner-title">
2626
let config = {
2727
license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", // Replace with your Dynamsoft license key
2828
container: document.querySelector(".barcode-scanner-view"), // Specify where to render the scanner UI
29+
30+
/*
31+
scanMode controls the scanning behavior:
32+
- SM_MULTI_UNIQUE: Continuously scans and collects each unique barcode.
33+
- SM_SINGLE: Stops scanning after the first barcode is detected.
34+
// Example:
35+
// scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
36+
37+
// onUniqueBarcodeScanned: (result) => {
38+
// // Called every time a barcode is decoded in MULTI_UNIQUE mode.
39+
// // You can add custom logic here, e.g.: let decodeCount = 0; // Declare an outside variable to keep track of decode count
40+
// // decodeCount++;
41+
// // if (decodeCount >= 3) {
42+
// // barcodeScanner._cvRouter.stopCapturing(); // Stop after 3 successful decodes
43+
// // barcodeScanner._cameraEnhancer.close(); // Close the camera
44+
// // }
45+
// },
46+
*/
47+
2948
// showUploadImageButton: true,
3049
// scannerViewConfig: {
3150
// showFlashButton: true,

0 commit comments

Comments
 (0)