Skip to content

Commit 984a330

Browse files
committed
Merge branch '2025_Nov_re-structure' of https://github.com/Dynamsoft/barcode-reader-javascript-samples into 2025_Nov_re-structure
2 parents 4f4b545 + a970749 commit 984a330

File tree

6 files changed

+70
-9
lines changed

6 files changed

+70
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ If you have any questions, feel free to [contact Dynamsoft support](https://www.
6464
- [show-result-texts-on-the-video/](./scenarios/show-result-texts-on-the-video/) — Overlay decoded text on live video while scanning.
6565
- [batch-inventory/](./scenarios/batch-inventory/) — Batch scanning workflow for inventory collection and export.
6666
- [read-a-drivers-license/](./scenarios/read-a-drivers-license/) — Demo for reading and parsing a driver's license image/data.
67+
- [read-vin/](./scenarios/read-vin/) — Demo for reading and parsing a VIN(vehicle identification number) code.
6768
- [read-and-parse-GS1-AI/](./scenarios/read-and-parse-GS1-AI/) — Example showing GS1 AI parsing and data extraction.
6869
- [scan-qr-code/](./scenarios/scan-qr-code/) — QR code targeted demo and settings.
6970
- [scan-common-1D-and-2D/](./scenarios/scan-common-1D-and-2D/) — Demo configured to detect a wide range of barcode formats.

index.html

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
</style>
3030
<!--
3131
For document, copy start from here
32-
search `href="frameworks` replace to `href="https://demo.dynamsoft.com/Samples/DBR/JS/frameworks`
3332
search `href="scenarios` replace to `href="https://demo.dynamsoft.com/Samples/DBR/JS/scenarios`
3433
-->
3534
<style>
3635
/* `balloon.min.css` used for tooltip styling */
3736
:root {
3837
--balloon-border-radius: 6px;
39-
--balloon-color: #24292e;
38+
/* use a slightly opaque background to mask underlying page text */
39+
--balloon-color: rgba(36,41,46,0.95);
4040
--balloon-text-color: #fff;
4141
--balloon-font-size: 13px;
4242
--balloon-move: 4px;
@@ -58,14 +58,21 @@
5858
font-style: normal;
5959
text-shadow: none;
6060
font-size: var(--balloon-font-size);
61+
/* solid background and slight blur to improve legibility over page content */
6162
background: var(--balloon-color);
6263
color: var(--balloon-text-color);
6364
border-radius: var(--balloon-border-radius);
6465
content: attr(aria-label);
65-
padding: 0.5em 1em;
66+
padding: 0.55em 0.9em;
6667
position: absolute;
68+
display: inline-block;
6769
white-space: nowrap;
68-
z-index: 10;
70+
z-index: 9999;
71+
box-shadow: 0 6px 18px rgba(0,0,0,0.35);
72+
-webkit-backdrop-filter: blur(3px);
73+
backdrop-filter: blur(3px);
74+
max-width: 90vw;
75+
overflow-wrap: break-word;
6976
}
7077
[aria-label][data-balloon-pos]:before {
7178
width: 0;
@@ -77,7 +84,7 @@
7784
transition: all 0.18s ease-out 0.18s;
7885
content: "";
7986
position: absolute;
80-
z-index: 10;
87+
z-index: 9999;
8188
}
8289
[aria-label][data-balloon-pos]:hover:before,
8390
[aria-label][data-balloon-pos]:hover:after,
@@ -1272,7 +1279,7 @@ <h3>
12721279
<!-- Scenario Samples -->
12731280
<div class="file">
12741281
<h3>
1275-
Scenario Samples <span class="sample-count">(16)</span>
1282+
Scenario Samples <span class="sample-count">(17)</span>
12761283
<a
12771284
class="button title readme-link section-readme-link"
12781285
href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/scenarios/README.md"
@@ -1384,7 +1391,7 @@ <h3>
13841391
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Demo focused on decoding common 2D barcode formats."
13851392
><a
13861393
class="button title demo-link"
1387-
href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/scan-common-2D-codes/index.html"
1394+
href="scenarios/scan-common-2D-codes/index.html"
13881395
title="View live demo"
13891396
>Scan Common 2D Codes</a
13901397
><a
@@ -1454,6 +1461,17 @@ <h3>
14541461
></span
14551462
>
14561463
</div>
1464+
<div class="file">
1465+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Read the VIN(vehicle identification number) code and parse it."
1466+
><a class="button title demo-link" href="scenarios/read-vin/index.html" title="View live demo">Read VIN</a
1467+
><a
1468+
class="button title source-link"
1469+
href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/read-vin"
1470+
title="View source code on GitHub"
1471+
>Source</a
1472+
></span
1473+
>
1474+
</div>
14571475
<div class="file">
14581476
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Example showing GS1 AI parsing and data extraction."
14591477
><a class="button title demo-link" href="scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/index.html" title="View live demo"

scenarios/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ Included samples
1010
- [show-result-texts-on-the-video/](./show-result-texts-on-the-video/) — Overlay decoded text on live video while scanning.
1111
- [batch-inventory/](./batch-inventory/) — Batch scanning workflow for inventory collection and export.
1212
- [read-a-drivers-license/](./read-a-drivers-license/) — Demo for reading and parsing a driver's license image/data.
13+
- [read-vin/](./read-vin/) — Demo for reading and parsing a VIN(vehicle identification number) code.
1314
- [read-and-parse-GS1-AI/](./read-and-parse-GS1-AI/) — Example showing GS1 AI parsing and data extraction.
1415
- [scan-qr-code/](./scan-qr-code/) — QR code targeted demo and settings.
16+
- [scan-datamatrix-code/](./scan-datamatrix-code/) — DataMatrix code targeted demo and settings.
1517
- [scan-common-1D-and-2D/](./scan-common-1D-and-2D/) — Demo configured to detect a wide range of barcode formats.
1618
- [scan-common-2D-codes/](./scan-common-2D-codes/) — Focused on common 2D barcode formats decoding.
1719
- [scan-1D-Retail/](./scan-1D-Retail/) — 1D retail barcode tuning example.

scenarios/read-a-drivers-license/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# 🪪 Read a Driver's License
1+
# 🚗 Read a Driver's License
22

33
A focused demo that decodes and parses barcode data from driver's license images (camera or file input). The sample demonstrates extracting structured fields (name, DOB, license number, address, etc.) using a parsing template.
44

55
## Included files
66

77
- `index.html` — main demo page (camera + image input UI).
88
- `SampleDriversLicense.jpg` — example license image.
9-
- `read_and_parse_dl.json`parsing template / configuration used by the sample.
9+
- `read_dl.json`JSON template used by the sample.
1010
- `style.css` — page styles.
1111

1212
## ✨ Features

scenarios/read-vin/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 🚗 Read a Vehicle Identification Number (VIN)
2+
3+
This focused demo decodes and parses VIN barcodes from vehicle images or live camera input. It shows how to extract structured VIN data and display results in a simple UI.
4+
5+
## Included files
6+
7+
- `index.html` — main demo page (camera + image/file input UI)
8+
- `SampleVIN.jpg` — example vehicle image with a VIN barcode (if not present, use your own test image)
9+
- `read_vin.json` — JSON template used by the sample. used by the sample
10+
11+
## Features
12+
13+
- Decode VIN barcodes from camera or static image (common 1D/2D formats used for VIN encoding)
14+
- Validate VIN length/characters and show parsing/validation results
15+
- Simple UI for testing images, camera input, and parsing rules
16+
17+
## How it works
18+
19+
- The demo initializes the barcode reader and captures either a selected image or live video frames from the camera.
20+
- When a barcode is detected, the raw text is displayed and validated against VIN rules (length 17, allowed characters). If a parsing template is available, parsed fields are shown alongside the raw VIN.
21+
22+
## Quick start
23+
24+
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/):
25+
26+
1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace.
27+
28+
2. Right-click on `index.html` and select "Open with Five Server".
29+
30+
## 💡 Tips
31+
32+
- Use high-resolution images or a higher camera resolution for reliable decoding and parsing.
33+
- If a barcode isn't found, try cropping the image to the VIN region or increase camera resolution.
34+
- VIN validation: the demo checks for 17 characters and excludes I, O, Q characters which are not used in VINs.
35+
36+
## Notes
37+
38+
- Serve via localhost or HTTPS to enable camera access.
39+
- Replace the included trial/demo license with a valid Dynamsoft license for extended evaluation.
40+
- See the repository root `README.md` for running instructions and API documentation.

scenarios/read-vin/SampleVIN.png

259 KB
Loading

0 commit comments

Comments
 (0)