Skip to content

Commit 6558d6d

Browse files
committed
2 parents 57a6710 + a339682 commit 6558d6d

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,34 @@ This repository contains multiple samples that demonstrates how to use the [Dyna
44

55
## Get the Code
66

7-
Since the repository has a lot of history, it is slow to clone directly. Please download the [zip](https://github.com/Dynamsoft/barcode-reader-javascript-samples/archive/refs/heads/main.zip)/[tar.gz](https://github.com/Dynamsoft/barcode-reader-javascript-samples/archive/refs/heads/main.tar.gz), or use the `--depth 1` to clone the code.
7+
Cloning the full repository may be slow due to its extensive history. To get started quickly, you have a few options:
8+
9+
- Download as [zip](https://github.com/Dynamsoft/barcode-reader-javascript-samples/archive/refs/heads/main.zip)
10+
- Download as [tar.gz](https://github.com/Dynamsoft/barcode-reader-javascript-samples/archive/refs/heads/main.tar.gz)
11+
- Shallow clone with Git:
12+
813
```git
914
git clone https://github.com/Dynamsoft/barcode-reader-javascript-samples.git --depth 1
1015
```
1116

17+
> [!NOTE]
18+
> If you expect unstable network conditions or prefer to work entirely offline, you can download the [offline package from Dynamsoft website](https://www.dynamsoft.com/barcode-reader/downloads/1000003-confirmation/). This includes the full repository and all required dependencies for offline use.
19+
>
20+
> **Running the Samples Locally**
21+
>
22+
> Opening HTML files directly may not work as expected. Instead, run a local development server. Here’s a quick method using [Visual Studio Code](https://code.visualstudio.com/):
23+
>
24+
> 1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace.
25+
>
26+
> 2. Right-click on `hello-world.html` and select "Open with Five Server". This will serve the application at `http://127.0.0.1:5500/hello-world.html`.
27+
1228
## Request a trial license
1329

1430
A default license is included which allows you to test the sample apps for up to 24 hours. You can [request a 30-day trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=sampleReadme) via Dynamsoft website to evaluate further.
1531

1632
## Documentation
1733

18-
For the developer guide and full API reference of Dynamsoft Barcode Reader JavaScript library, please check out the [documentation](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/?ver=10.5.1000&utm_source=sampleReadme).
34+
For the developer guide and full API reference of Dynamsoft Barcode Reader JavaScript library, please check out the [documentation](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/?ver=10.5.3000&utm_source=sampleReadme).
1935

2036
## Support
2137

@@ -30,6 +46,7 @@ If you have any questions, feel free to [contact Dynamsoft support](https://www.
3046
Get the basic features working with plain/native JavaScript or within a framework like [Angular](https://angular.io/), [React](https://reactjs.org/) or [Vue](https://vuejs.org/), with RTU-BarcodeScanner APIs.
3147

3248
* [**Scan Single Barcode**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/hello-world.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-single-barcode/hello-world.html?utm_source=sampleReadme): Scan single barcode from video stream with minimum code in JavaScript.
49+
* [**Scan Single Barcode**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/scan-and-search.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-single-barcode/scan-and-search.html?utm_source=sampleReadme): Scan a barcode to retrieve the relevant product information from the database in JavaScript.
3350
* [**Hello World in Angular**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/angular): Read single barcode from camera in an Angular application.
3451
* [**Hello World in React**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/react): Read single barcode from camera in a React application.
3552
* [**Hello World in Vue**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/vue): Read single barcode from camera in a Vue application.

barcode-scanner-api-samples/scan-multiple-barcodes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ A list of 20 dummy products is used, with each scan randomly adding a product to
7373
Multiple samples are provided for single barcode scanning. These samples can be easily adapted to scan multiple unique barcodes by simply updating the `config` object.
7474

7575
* [**Hello World**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode): Scan single barcode from video stream with minimum code in JavaScript.
76+
* [**Scan and Search**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode): Scan a barcode to retrieve the relevant product information from the database in JavaScript.
7677
* [**Hello World in Angular**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/angular): Read single barcode from camera in an Angular application.
7778
* [**Hello World in React**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/react): Read single barcode from camera in a React application.
7879
* [**Hello World in Vue**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/vue): Read single barcode from camera in a Vue application.

barcode-scanner-api-samples/scan-single-barcode/README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# 📦 Scan Single Barcode - Hello World
1+
# 📦 Scan Single Barcode
2+
3+
## 🚀 1.Hello World
24

35
This sample demonstrates how to use the `BarcodeScanner` API from the [Dynamsoft Barcode Reader JavaScript SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/) to scan a **single barcode** from a video stream using plain JavaScript.
46

5-
## ✨ Features
7+
### ✨ Features
68

79
- Uses `BarcodeScanner` APIs from `dynamsoft-barcode-reader-bundle`
810
- Scans a single barcode at a time
911
- UI rendered to a container element
1012

11-
## 🔧 How It Works
13+
### 🔧 How It Works
1214

1315
The sample uses the `BarcodeScanner` class to launch a scanner and decode a single barcode from a camera stream. The key configuration includes:
1416

@@ -34,11 +36,34 @@ const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
3436
barcodeScanner.launch();
3537
```
3638

37-
## 📌 Notes
39+
### 📌 Notes
3840

3941
- This sample scans one **single barcode**, you can configure `scanMode` to change the behavior to scan multiple barcodes.
4042
- To avoid network-related loading issues, consider hosting all required resources locally.
4143

44+
## 🛒 2. Scan and Search
45+
46+
This simple demonstrates how to use the `BarcodeScanner` API from the [Dynamsoft Barcode Reader JavaScript SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/) to scan a product barcode and simulate a search from a product database.
47+
48+
### ✨ Features
49+
50+
- Scan Barcodes using your device camera
51+
- Search by Text or Barcode input
52+
- Displays mock product data as search results
53+
- Responsive UI with modern styling
54+
55+
### 🔧 How It Works
56+
57+
1. Click the Scan button to launch the barcode scanner.
58+
2. Once a barcode is detected, its value is displayed along with placeholder product information.
59+
3. Alternatively, type a product name or barcode manually in the input field and click Search.
60+
4. Results are displayed in the Search Result text area.
61+
62+
### 📌 Notes
63+
64+
- No real backend is connected in this demo; results are mocked.
65+
- You can integrate with a real product API by replacing the placeholder content in the searchResult.value.
66+
4267
## 📄 See other BarcodeScanner samples
4368

4469
* [**Hello World in Angular**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/angular): Read single barcode from camera in an Angular application.
@@ -48,4 +73,4 @@ barcodeScanner.launch();
4873
Scan multiple barcodes:
4974

5075
* [**Hello World**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes): Scan multiple barcodes from video stream with minimum code in JavaScript.
51-
* [**Cart Builder**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes): Simulates a shopping experience where users scan barcodes to add items to a dynamic cart.
76+
* [**Cart Builder**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes): Simulates a shopping experience where users scan barcodes to add items to a dynamic cart.

0 commit comments

Comments
 (0)