A focused demo that decodes GS1-formatted barcodes and parses Application Identifiers (AIs) to extract structured product and logistic data (GTIN, batch/lot, expiry, weight, serial, etc.). This folder contains two implementation styles so you can choose the integration that best fits your project.
- scan-using-foundational-api/ — Foundational single-file implementation:
index.html— demo page.index.css— styles used by the foundational demo.read_and_parse_gs1.json— GS1 template file used by this implementation.
- Decode GS1 barcodes (GS1-128 / EAN / GS1 Databar variants) from live camera or static image inputs.
- Parse AI-tagged payloads into structured fields (GTIN, batch/lot, expiry, weight, serial, etc.).
- The demos initialize the barcode scanner to decode GS1 payloads from camera frames or image files.
- Decoded GS1 strings are parsed according to the provided JSON template (mapping AIs to labels and formats).
Opening HTML files directly may not work as expected. Instead, run a local development server. Here's a quick method using Visual Studio Code:
-
Install the Five Server extension from the VS Code Marketplace.
-
Right-click on
index.htmland select "Open with Five Server".
- Use high-resolution images or increase camera resolution for small or dense GS1 fields.
- Validate AI date/number formats (some AIs imply decimal places or YY/MM/YY formats).
- Serve the demos via localhost or HTTPS to allow camera access.
- Replace the included trial/demo license with a valid Dynamsoft license for extended evaluation or production use.
- See the repository root
README.mdfor running instructions, licensing and API documentation links.