Skip to content

Commit 64fc305

Browse files
committed
add comment
1 parent b5420d3 commit 64fc305

File tree

12 files changed

+2026
-1977
lines changed

12 files changed

+2026
-1977
lines changed

barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html

Lines changed: 247 additions & 239 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,90 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>
7-
Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera)
8-
</title>
9-
<!-- Include Dynamsoft Barcode Reader Bundle from CDN -->
10-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000-beta-202504231853/dist/dbr.bundle.js"></script>
11-
12-
<style>
13-
/* Reset default margins and paddings, apply consistent box-sizing */
14-
* {
15-
margin: 0;
16-
padding: 0;
17-
box-sizing: border-box;
18-
}
19-
20-
/* Make html and body take up the full viewport */
21-
html,
22-
body {
23-
width: 100%;
24-
height: 100%;
25-
}
26-
27-
/* Style for the scanner title/header */
28-
.barcode-scanner-title {
29-
height: 80px;
30-
text-align: center;
31-
font-size: 20px;
32-
padding: 20px 0;
33-
}
34-
35-
/* Container where the barcode scanner will display the camera feed */
36-
.barcode-scanner-view {
37-
width: 100%;
38-
height: calc(100% - 80px); /* Remaining space after header */
39-
}
40-
</style>
41-
</head>
42-
43-
<body>
44-
<h1 class="barcode-scanner-title">
45-
Hello World (Scan Multiple Barcodes via Camera)
46-
</h1>
47-
<!-- This div will act as the container for the barcode scanner UI -->
48-
<div class="barcode-scanner-view"></div>
49-
50-
<script>
51-
// Configuration object for initializing the BarcodeScanner instance. Refer to https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig
52-
let config = {
53-
// Replace with your Dynamsoft license key
54-
license: "YOUR-LICENSE-KEY",
55-
56-
// Specify where to render the scanner UI
57-
container: ".barcode-scanner-view",
58-
59-
// Set scan mode to detect multiple unique barcodes per scan session
60-
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
61-
62-
// Display a result view for barcodes detected
63-
showResultView: true,
64-
65-
// Enable an "Upload Image" button for scanning barcodes from existing images
66-
showUploadImageButton: true,
67-
68-
// Additional configuration for the scanner UI
69-
scannerViewConfig: {
70-
showCloseButton: true, // Display a close button on the scanner interface
71-
},
72-
};
73-
74-
// Instantiate the barcode scanner with the above configuration
75-
const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
76-
77-
// Launch the scanner and handle the scan result
78-
barcodeScanner.launch().then((result) => {
79-
// Log the full result object to the console for debugging or further processing
80-
console.log(result);
81-
});
82-
</script>
83-
</body>
84-
</html>
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>
8+
Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera)
9+
</title>
10+
<!-- Include Dynamsoft Barcode Reader Bundle from CDN -->
11+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000-beta-202504231853/dist/dbr.bundle.js"></script>
12+
<!-- If the network is unstable or you prefer to self-host the SDK, uncomment the line below to load it locally -->
13+
<!-- <script src="../../../distributables/dbr.bundle.js"></script> -->
14+
15+
16+
<style>
17+
/* Reset default margins and paddings, apply consistent box-sizing */
18+
* {
19+
margin: 0;
20+
padding: 0;
21+
box-sizing: border-box;
22+
}
23+
24+
/* Make html and body take up the full viewport */
25+
html,
26+
body {
27+
width: 100%;
28+
height: 100%;
29+
}
30+
31+
/* Style for the scanner title/header */
32+
.barcode-scanner-title {
33+
height: 80px;
34+
text-align: center;
35+
font-size: 20px;
36+
padding: 20px 0;
37+
}
38+
39+
/* Container where the barcode scanner will display the camera feed */
40+
.barcode-scanner-view {
41+
width: 100%;
42+
height: calc(100% - 80px);
43+
/* Remaining space after header */
44+
}
45+
</style>
46+
</head>
47+
48+
<body>
49+
<h1 class="barcode-scanner-title">
50+
Hello World (Scan Multiple Barcodes via Camera)
51+
</h1>
52+
<!-- This div will act as the container for the barcode scanner UI -->
53+
<div class="barcode-scanner-view"></div>
54+
55+
<script>
56+
// Configuration object for initializing the BarcodeScanner instance. Refer to https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig
57+
let config = {
58+
// Replace with your Dynamsoft license key
59+
license: "YOUR-LICENSE-KEY",
60+
61+
// Specify where to render the scanner UI
62+
container: ".barcode-scanner-view",
63+
64+
// Set scan mode to detect multiple unique barcodes per scan session
65+
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
66+
67+
// Display a result view for barcodes detected
68+
showResultView: true,
69+
70+
// Enable an "Upload Image" button for scanning barcodes from existing images
71+
showUploadImageButton: true,
72+
73+
// Additional configuration for the scanner UI
74+
scannerViewConfig: {
75+
showCloseButton: true, // Display a close button on the scanner interface
76+
},
77+
};
78+
79+
// Instantiate the barcode scanner with the above configuration
80+
const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
81+
82+
// Launch the scanner and handle the scan result
83+
barcodeScanner.launch().then((result) => {
84+
// Log the full result object to the console for debugging or further processing
85+
console.log(result);
86+
});
87+
</script>
88+
</body>
89+
90+
</html>
Lines changed: 63 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,74 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>
7-
Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera)
8-
</title>
93

10-
<!-- Include Dynamsoft Barcode Reader Bundle via CDN -->
11-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000-beta-202504231853/dist/dbr.bundle.js"></script>
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>
8+
Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera)
9+
</title>
1210

13-
<style>
14-
/* Reset default margin and padding, and apply border-box sizing */
15-
* {
16-
margin: 0;
17-
padding: 0;
18-
box-sizing: border-box;
19-
}
11+
<!-- Include Dynamsoft Barcode Reader Bundle via CDN -->
12+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.5.3000-beta-202504231853/dist/dbr.bundle.js"></script>
13+
<!-- If the network is unstable or you prefer to self-host the SDK, uncomment the line below to load it locally -->
14+
<!-- <script src="../../../distributables/dbr.bundle.js"></script> -->
2015

21-
/* Ensure html and body take full viewport size */
22-
html,
23-
body {
24-
width: 100%;
25-
height: 100%;
26-
}
2716

28-
/* Style for the scanner title */
29-
.barcode-scanner-title {
30-
height: 80px;
31-
text-align: center;
32-
font-size: 20px;
33-
padding: 20px 0;
34-
}
17+
<style>
18+
/* Reset default margin and padding, and apply border-box sizing */
19+
* {
20+
margin: 0;
21+
padding: 0;
22+
box-sizing: border-box;
23+
}
3524

36-
/* Container where the barcode scanner will be rendered */
37-
.barcode-scanner-view {
38-
width: 100%;
39-
height: calc(100% - 80px); /* Fill remaining space below the title */
40-
}
41-
</style>
42-
</head>
25+
/* Ensure html and body take full viewport size */
26+
html,
27+
body {
28+
width: 100%;
29+
height: 100%;
30+
}
4331

44-
<body>
45-
<h1 class="barcode-scanner-title">
46-
Hello World (Scan One Single Barcode via Camera)
47-
</h1>
48-
<!-- This div will host the barcode scanner's camera view -->
49-
<div class="barcode-scanner-view"></div>
32+
/* Style for the scanner title */
33+
.barcode-scanner-title {
34+
height: 80px;
35+
text-align: center;
36+
font-size: 20px;
37+
padding: 20px 0;
38+
}
5039

51-
<script>
52-
// Configuration object for initializing the BarcodeScanner instance. Refer to https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig
53-
let config = {
54-
license: "YOUR-LICENSE-KEY", // Replace with your Dynamsoft license key
55-
container: ".barcode-scanner-view", // Specify where to render the scanner UI
56-
};
40+
/* Container where the barcode scanner will be rendered */
41+
.barcode-scanner-view {
42+
width: 100%;
43+
height: calc(100% - 80px);
44+
/* Fill remaining space below the title */
45+
}
46+
</style>
47+
</head>
5748

58-
// Create a new instance of the Dynamsoft Barcode Scanner
59-
const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
49+
<body>
50+
<h1 class="barcode-scanner-title">
51+
Hello World (Scan One Single Barcode via Camera)
52+
</h1>
53+
<!-- This div will host the barcode scanner's camera view -->
54+
<div class="barcode-scanner-view"></div>
6055

61-
// Launch the scanner and handle the scanned result
62-
barcodeScanner.launch().then((result) => {
63-
// Display the first detected barcode's text in an alert
64-
alert(result.barcodeResults[0].text);
65-
});
66-
</script>
67-
</body>
68-
</html>
56+
<script>
57+
// Configuration object for initializing the BarcodeScanner instance. Refer to https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig
58+
let config = {
59+
license: "YOUR-LICENSE-KEY", // Replace with your Dynamsoft license key
60+
container: ".barcode-scanner-view", // Specify where to render the scanner UI
61+
};
62+
63+
// Create a new instance of the Dynamsoft Barcode Scanner
64+
const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
65+
66+
// Launch the scanner and handle the scanned result
67+
barcodeScanner.launch().then((result) => {
68+
// Display the first detected barcode's text in an alert
69+
alert(result.barcodeResults[0].text);
70+
});
71+
</script>
72+
</body>
73+
74+
</html>

foundational-api-samples/hello-world/es6.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ <h1>Hello World for ES6 (Decode via Camera)</h1>
2323
CameraEnhancer,
2424
MultiFrameResultCrossFilter,
2525
} from "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.4.3100/dist/dbr.bundle.mjs";
26+
2627
/** LICENSE ALERT - README
2728
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below.
2829
*/

0 commit comments

Comments
 (0)