diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27274eef..5c555d93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,4 +35,4 @@ jobs: password: ${{ secrets.FTP_DEMO_PASSWORD }} port: 21 local-dir: /home/ubuntu/barcode-reader-javascript-samples/ - server-dir: /Demo.dynamsoft.com/Samples/DBR/JS/ + server-dir: /Demo.dynamsoft.com/Samples/DBR/JS/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index dbf6e269..d4d30b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,10 @@ yarn.lock /.gitattributes /.*ignore +# Build artifacts +obj/ +.gradle/ + !bower.json !composer.json !package.js \ No newline at end of file diff --git a/README.md b/README.md index d4cac864..37ea01c4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A default license is included which allows you to test the sample apps for up to ## Documentation -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=11.0.6000&utm_source=sampleReadme). +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=11.2.4000&utm_source=sampleReadme). ## Support @@ -39,67 +39,42 @@ If you have any questions, feel free to [contact Dynamsoft support](https://www. ## Sample list -### Barcode Scanner API samples - -**Scan single barcode** - -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. - -* [**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. -* [**Scan And Search**](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. -* [**Pick One to Fill**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.html?utm_source=sampleReadme): Pick one and auto-fill fields by simply opening the camera and scanning a group of barcodes. -* [**Use Customized Template**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html?utm_source=sampleReadme): Use different customized templates for scanning various barcode types. -* [**Read and Parse GS1-AI**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html?utm_source=sampleReadme): Read GS1 Application Identifier (AI) barcode and parse its structured data. -* [**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. -* [**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. -* [**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. -* [**Hello World in Svelte**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/svelte): Read single barcode from camera in a Svelte application. -* [**Hello World in Capacitor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/capacitor): Read single barcode from camera in a Capacitor application. -* [**Hello World in Webview**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/webview): Read single barcode from camera in a Webview application. -* [**Hello World in Typescript**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/native-ts): Read single barcode from camera in a Typescript application. -* [**Hello World in Electron**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/electron): Read single barcode from camera in a Electron application. -* [**Hello World in Blazor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/blazor): Read single barcode from camera in a Blazor application. -* [**Hello World in RequireJS**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/requirejs.html): Read single barcode from camera in a RequireJS application. -* [**Hello World in ES6**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/es6.html): Read single barcode from camera in a ES6 application. -* [**Hello World in PWA**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/pwa): Read single barcode from camera in a PWA application. - -**Scan multiple barcodes** - -* [**Scan Multiple Barcodes**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-multiple-barcodes/hello-world.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-multiple-barcodes/hello-world.html?utm_source=sampleReadme): Scan barcodes from video stream with minimum code in JavaScript. -* [**Cart Builder**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html?utm_source=sampleReadme): Simulates a shopping experience where users scan barcodes to add items to a dynamic cart in JavaScript. -* [**Batch Inventory**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.html?utm_source=sampleReadme): An inventory management tool scan barcodes in batches and provide real-time analysis of the scanned data. - -### Foundational API samples - -**Hello World** - -Get the basic features of the library working with plain/native JavaScript or within a framework like [Angular](https://angular.io/), [React](https://reactjs.org/) or [Vue](https://vuejs.org/), etc. - -* [**Hello World**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/hello-world.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/hello-world/hello-world.html?utm_source=sampleReadme): Scan barcodes from video stream with minimum code in JavaScript. -* [**Read an Image**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/read-an-image.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/hello-world/read-an-image.html?utm_source=sampleReadme): Decode barcodes from images in mobile album or desktop file system. -* [**Hello World in Angular**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/angular#readme): Read barcodes from camera and images in an Angular application. -* [**Hello World in Blazor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/blazor#readme): Read barcodes from camera and images in a Blazor application. -* [**Hello World in React**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/react#readme): Read barcodes from camera and images in a React application. -* [**Hello World in React using Hooks**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/react-hooks#readme): Read barcodes from camera and images in a React application and use the Hooks charactor of React. -* [**Hello World in Vue**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/vue#readme): Read barcodes from camera and images in a Vue 3 application. -* [**Hello World in Next.js**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/next#readme): Read barcodes from camera and images in a Next.js application. -* [**Hello World in Nuxt**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/nuxt#readme): Read barcodes from camera and images in a Nuxt application. -* [**Hello World in Electron**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/electron#readme): Read barcodes from camera and images in a Electron application. -* [**Hello World in PWA**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/pwa#readme): Decode video stream in a PWA application from a webcam or a built-in camera. -* [**Hello World with RequireJS**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/requirejs.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/hello-world/requirejs.html?utm_source=sampleReadme): Decode video stream in an application using RequireJS from a webcam or a built-in camera. -* [**Hello World with ES6**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/es6.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/hello-world/es6.html?utm_source=sampleReadme): Decode video stream in an application using ES6 from a webcam or a built-in camera. -* [**Hello World in WebView**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/hello-world/webview): Decode video stream in an application in WebView from camera. - -***Use Cases*** - -* [**Read Video and Fill a Form**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html?utm_source=sampleReadme): Read barcodes to fill a form. -* [**Read a Driver's License**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/use-case/read-a-drivers-license/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/use-case/read-a-drivers-license/index.html?utm_source=sampleReadme): Read the PDF417 barcode on a driver's license (AAMVA compliant) and parse it. -* [**Show Result Texts on the Video**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/use-case/show-result-texts-on-the-video.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/use-case/show-result-texts-on-the-video.html?utm_source=sampleReadme): Read barcodes via camera and show result texts on the video. -* [**Locate an Item with Barcode**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html) - [run↗](https://demo.dynamsoft.com/samples/dbr/js/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html?utm_source=sampleReadme): Find a specific item in a large collection by scanning its unique barcode - -***Others*** - -* [**Debug**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/foundational-api-samples/others/debug#readme): Collect the actual image frames for debugging purposes. +### Frameworks + +- [angular/](./frameworks/angular/) — Angular examples. +- [blazor/](./frameworks/blazor/) — Blazor (.NET) examples. +- [capacitor/](./frameworks/capacitor/) — Capacitor mobile hybrid examples. +- [electron/](./frameworks/electron/) — Electron desktop examples. +- [es6/](./frameworks/es6/) — Plain ES6 module examples. +- [native-ts/](./frameworks/native-ts/) — Native TypeScript examples. +- [next/](./frameworks/next/) — Next.js examples. +- [nuxt/](./frameworks/nuxt/) — Nuxt examples. +- [pwa/](./frameworks/pwa/) — Progressive Web App examples. +- [react/](./frameworks/react/) — React examples. +- [requirejs/](./frameworks/requirejs/) — RequireJS (AMD) examples. +- [svelte/](./frameworks/svelte/) — Svelte examples. +- [vue/](./frameworks/vue/) — Vue examples. +- [webview/](./frameworks/webview/) — Native WebView examples for Android/iOS. + +### Scenarios + +- [pick-one-to-fill/](./scenarios/pick-one-to-fill/) — Picking the correct one from multiple candidates by scanning barcodes. +- [cart-builder/](./scenarios/cart-builder/) — Single-page demo illustrating adding scanned items into a shopping cart. +- [scan-and-search/](./scenarios/scan-and-search/) — Example that scans a barcode and performs a lookup/search operation. +- [show-result-texts-on-the-video/](./scenarios/show-result-texts-on-the-video/) — Overlay decoded text on live video while scanning. +- [batch-inventory/](./scenarios/batch-inventory/) — Batch scanning workflow for inventory collection and export. +- [read-a-drivers-license/](./scenarios/read-a-drivers-license/) — Demo for reading and parsing a driver's license image/data. +- [read-vin/](./scenarios/read-vin/) — Demo for reading and parsing a VIN(vehicle identification number) code. +- [read-and-parse-GS1-AI/](./scenarios/read-and-parse-GS1-AI/) — Example showing GS1 AI parsing and data extraction. +- [scan-qr-code/](./scenarios/scan-qr-code/) — QR code targeted demo and settings. +- [scan-common-1D-and-2D/](./scenarios/scan-common-1D-and-2D/) — Demo configured to detect a wide range of barcode formats. +- [scan-common-2D-codes/](./scenarios/scan-common-2D-codes/) — Focused on common 2D barcode formats decoding. +- [scan-datamatrix-code/](./scenarios/scan-datamatrix-code/) — DataMatrix code targeted demo with optimized settings. +- [scan-1D-Retail/](./scenarios/scan-1D-Retail/) — 1D retail barcode tuning example. +- [scan-1D-Industrial/](./scenarios/scan-1D-Industrial/) — 1D industrial barcode tuning example. +- [scan-from-distance/](./scenarios/scan-from-distance/) — Demo for scanning barcodes from a distance (zoom/ROI tuning). +- [locate-an-item-with-barcode/](./scenarios/locate-an-item-with-barcode/) — UI to help locate items with barcodes in a list or layout. +- [debug/](./scenarios/debug/) — Debug utilities and a small server (frame collector) used for testing and troubleshooting. ### Official Online Demo diff --git a/barcode-scanner-api-samples/scan-multiple-barcodes/README.md b/barcode-scanner-api-samples/scan-multiple-barcodes/README.md deleted file mode 100644 index 6d473539..00000000 --- a/barcode-scanner-api-samples/scan-multiple-barcodes/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -# 📦 Scan Multiple Barcodes Samples - -## 🚀 1. Hello World - -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 **multiple barcodes continuously** from a video stream in a web application. - -### ✨ Features - -- Scan multiple 1D/2D barcodes -- Live video decoding using `BarcodeScanner` component -- Easy integration into your web application -- UI rendered into a customizable container - -### 🔧 How It Works - -The sample uses the `BarcodeScanner` class to launch a scanner and decode barcodes from a camera stream. The key configuration includes: - -- **License Key** – Required to activate the SDK. -- **`engineResourcePaths`** – Points to required resources hosted on a CDN or locally. -- **UI container** – An HTML element where the scanner is rendered. - -```ts -const config = { - license: "YOUR-LICENSE-KEY", - engineResourcePaths: { - // feel free to change it to your own path - rootDirectory: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.2.4000/dist/", - }, - container: ".barcode-scanner-view", - scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE, - showResultView: true, - showUploadImageButton: true, - scannerViewConfig: { - showCloseButton: true - }, -}; -``` - -The BarcodeScanner instance is created and launched like this: - -```ts -const barcodeScanner = new Dynamsoft.BarcodeScanner(config); -barcodeScanner.launch(); -``` - -### 📌 Notes - -- This sample scans **multiple unique barcodes**, you can configure `scanMode` to change the behavior to scan one single barcode. -- To avoid network-related loading issues, consider hosting all required resources locally. - -## 🛒 2. Cart Builder - -This sample simulates a shopping experience where users scan barcodes to add items to a dynamic cart. - -### ✨ Features - -- Scan multiple 1D/2D barcodes -- Live video decoding using `BarcodeScanner` component -- Floating and draggable scanner window. -- Dynamic cart updates on each scan. - -### 🔧 How It Works - -The scanning logic mirrors the Hello World sample, but scanned results populate the cart instead of just displaying in the result view. - -The UI features a "Scan Barcode" button, a styled cart, and basic interactivity with vanilla JavaScript and CSS. - -A list of 20 dummy products is used, with each scan randomly adding a product to the cart showing its name, shortened barcode, and price. - -## 🛒 3. Batch inventory - -This project is a simple web-based inventory management tool that uses `BarcodeScanner` to scan barcodes in batches and provide real-time analysis of the scanned data. - -### ✨ Features - -- Automatically deduplicate barcodes in each session - -- Show session summary: - - Total unique barcodes - - Barcode type distribution - - Session duration - -- Track duration of each scan session - -### 🔧 How It Works - -- The scanner is embedded using `BarcodeScanner` with `SM_MULTI_UNIQUE` mode to capture unique barcodes. - -- Once the scan completes, the results are analyzed. - -- You can click the back arrow to restart scanning. - -### 📌 Notes - -- The barcode value must be unique, otherwise it won’t be counted. - -- Applicable scenarios may include: - - - Warehouse inventory checks - - Retail stock intake - - Barcode-based asset tracking - - Batch QR code scanning - -## 📄 See other BarcodeScanner samples - -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. - -* [**Hello World**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/hello-world.html): Scan single barcode from video stream with minimum code in JavaScript. -* [**Scan and Search**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/sacn-and-search.html): Scan a barcode to retrieve the relevant product information from the database in JavaScript. -* [**Pick one to fill**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill): Pick one and auto-fill fields by simply opening the camera and scanning a group of barcodes. -* [**Use customized template**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/use-customized-template): Use different customized templates for scanning various barcode types. -* [**Read and Parse GS1-AI**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI): Read GS1 Application Identifier (AI) barcode and parse its structured data. -* [**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. -* [**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. -* [**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. -* [**Hello World in Svelte**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/svelte): Read single barcode from camera in a Svelte application. -* [**Hello World in Capacitor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/capacitor): Read single barcode from camera in a Capacitor application. -* [**Hello World in Webview**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/webview): Read single barcode from camera in a Webview application. -* [**Hello World in Typescript**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/native-ts): Read single barcode from camera in a Typescript application. -* [**Hello World in Electron**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/electron): Read single barcode from camera in a Electron application. -* [**Hello World in Blazor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/blazor): Read single barcode from camera in a Blazor application. -* [**Hello World in RequireJS**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/requirejs.html): Read single barcode from camera in a RequireJS application. -* [**Hello World in ES6**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/es6.html): Read single barcode from camera in a ES6 application. -* [**Hello World in PWA**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/pwa): Read single barcode from camera in a PWA application. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-multiple-barcodes/hello-world.html b/barcode-scanner-api-samples/scan-multiple-barcodes/hello-world.html deleted file mode 100644 index 4a2bbc3c..00000000 --- a/barcode-scanner-api-samples/scan-multiple-barcodes/hello-world.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera) - - - - - - - - - - - -

- Hello World (Scan Multiple Barcodes via Camera) -

- -
- - - - - \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/README.md b/barcode-scanner-api-samples/scan-single-barcode/README.md deleted file mode 100644 index fe965170..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/README.md +++ /dev/null @@ -1,170 +0,0 @@ -# 📦 Scan Single Barcode - -## 🚀 1.Hello World - -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. - -### ✨ Features - -- Uses `BarcodeScanner` APIs from `dynamsoft-barcode-reader-bundle` -- Scans a single barcode at a time -- UI rendered to a container element - -### 🔧 How It Works - -The sample uses the `BarcodeScanner` class to launch a scanner and decode a single barcode from a camera stream. The key configuration includes: - -- **License Key** – Required to activate the SDK. -- **`engineResourcePaths`** – Points to required resources hosted on a CDN or locally. -- **UI container** – An HTML element where the scanner is rendered. - -```ts -const config = { - license: "YOUR-LICENSE-KEY", - engineResourcePaths: { - // feel free to change it to your own path - rootDirectory: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.2.4000/dist/", - }, - container: ".barcode-scanner-view", -}; -``` - -The BarcodeScanner instance is created and launched like this: - -```ts -const barcodeScanner = new Dynamsoft.BarcodeScanner(config); -barcodeScanner.launch(); -``` - -### 📌 Notes - -- This sample scans one **single barcode**, you can configure `scanMode` to change the behavior to scan multiple barcodes. -- To avoid network-related loading issues, consider hosting all required resources locally. - -## 🛒 2. Scan and Search - -This simple demonstrates how to use the `BarcodeScanner` API to scan a product barcode and simulate a search from a product database. - -### ✨ Features - -- Scan Barcodes using your device camera -- Search by Text or Barcode input -- Displays mock product data as search results -- Responsive UI with modern styling - -### 🔄 Sample Usage Flow - -1. Click the Scan button to launch the barcode scanner. -2. Once a barcode is detected, its value is displayed along with placeholder product information. -3. Alternatively, type a product name or barcode manually in the input field and click Search. -4. Results are displayed in the Search Result text area. - -### 📌 Notes - -- No real backend is connected in this demo; results are mocked. -- You can integrate with a real product API by replacing the placeholder content in the searchResult.value. - -## 📷 3. Pick One To Fill - -A web-based form-filling utility that uses the `BarcodeScanner` to scan and auto-fill fields by simply opening the camera and scanning a barcode. - -### ✨ Features - -- Field-specific Camera Activation -Open the camera individually for different fields. - -- Manual control when to start decoding -Start decoding manually after aiming at the target to reduce the risk of misreads and missed barcodes. - -- Auto-Fill with Scan Result -Automatically populates input fields with scanned barcode values. - -### 🔄 Sample Usage Flow - -1. Click the "Open Camera" button to activate the camera. - -2. Aim at the sample image shown below. - -3. Click the "Decode" button to start barcode recognition. - -4. If only one barcode is detected, its value will be automatically filled into the corresponding field. - If multiple barcodes are detected, the video stream will freeze, and you’ll need to manually select one from the decoded results to fill in. - -### 📌 Notes - -- This usage is especially suitable for scenarios with densely packed barcodes, where secondary confirmation or manual selection is highly needed. -- You can find a sample reference image in `./pick-one-to-fill/`. - -## 🎥 4. Use Customized Template - -This is a sample web application demonstrating how to use the `BarcodeScanner` with different customized templates for scanning various barcode types. - -It allows users to dynamically select a scanning template (e.g., DPM, Dot Code, OneD Retail, OneD Industrial), and launch a camera-based barcode scanner accordingly. - -### ✨ Features - -- Support for custom barcode scanning templates using local JSON files. - -- Easily switch between different template configurations. - -### 🔄 Sample Usage Flow - -1. Open the HTML file in a browser. The app will automatically initialize the scanner using the ReadDPM template. - -2. Choose from the available templates: - - Direct Part Marking (DPM) - - Dot Code - - OneD Retail - - OneD Industrial - - Scanner Loads with Selected Template. When a new template is selected, the scanner is re-initialized using the corresponding .json file. - -3. Point your camera at a barcode matching the selected template type. A popup alert will display the result upon successful detection. - -### 📌 Notes - -- The scanner is disposed and recreated every time a different template is selected, ensuring the correct settings are applied. -- You can find sample images in `./use-customized-template/`. - -## 🧾 5. Read and Parse GS1 AI - -This sample demonstrates how to read a GS1-formatted barcode string (containing Application Identifiers, AIs) and parse it into human‑readable fields using a local AI definition file. - -### ✨ Features - -- Parse GS1 AI strings into labeled fields (GTIN, expiration, batch/lot, serial, etc.). -- Map AI keys to readable titles. -- Browser example with a small UI (`index.html`) and styling (`style.css`). -- Utility script (`convert-GS1AI-title.js`) that converts raw GS1 data to a structured object. - -### 🔧 How It Works - -- `index.html` provides an input area where you can paste a scanned GS1 barcode value (or test values). -- `convert-GS1AI-title.js` parses the GS1 string into AI-value pairs and looks up human-friendly labels. -- Parsed results are shown in the page for easy inspection or copy-paste into downstream systems. - -### 📌 Notes - -- This sample focuses on parsing and presentation; integrate the parser into your scanner workflow to convert live scan results to structured data. -- For accurate parsing of variable-length AIs, ensure your input uses proper GS1 separators when applicable. - -## 📄 See other BarcodeScanner samples - -* [**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. -* [**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. -* [**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. -* [**Hello World in Svelte**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/svelte): Read single barcode from camera in a Svelte application. -* [**Hello World in Capacitor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/capacitor): Read single barcode from camera in a Capacitor application. -* [**Hello World in Webview**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/webview): Read single barcode from camera in a Webview application. -* [**Hello World in Typescript**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/native-ts): Read single barcode from camera in a Typescript application. -* [**Hello World in Electron**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/electron): Read single barcode from camera in a Electron application. -* [**Hello World in Blazor**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/blazor): Read single barcode from camera in a Blazor application. -* [**Hello World in RequireJS**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/requirejs.html): Read single barcode from camera in a RequireJS application. -* [**Hello World in ES6**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/es6.html): Read single barcode from camera in a ES6 application. -* [**Hello World in PWA**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/pwa): Read single barcode from camera in a PWA application. - -Scan multiple barcodes: - -* [**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. -* [**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. -* [**Batch Inventory**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/main/barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.html): An inventory management tool scan barcodes in batches and provide real-time analysis of the scanned data. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDotcode.json b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDotcode.json deleted file mode 100644 index f552988d..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDotcode.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "BarcodeFormatSpecificationOptions": [ - { - "BarcodeFormatIds": [ - "BF_DOTCODE" - ], - "MinResultConfidence": 0, - "Name": "FP_1" - } - ], - "BarcodeReaderTaskSettingOptions": [ - { - "BarcodeFormatIds": [ - "BF_DOTCODE" - ], - "BarcodeFormatSpecificationNameArray": [ - "FP_1" - ], - "ExpectedBarcodesCount": 1, - "Name": "BR_1", - "SectionArray": [ - { - "ImageParameterName": "IP_1", - "Section": "ST_REGION_PREDETECTION", - "StageArray": [ - { - "Stage": "SST_PREDETECT_REGIONS" - } - ] - }, - { - "ImageParameterName": "IP_1", - "Section": "ST_BARCODE_LOCALIZATION", - "StageArray": [ - { - "LocalizationModes": [ - { - "Mode": "LM_STATISTICS_MARKS" - } - ], - "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" - } - ] - }, - { - "ImageParameterName": "IP_1", - "Section": "ST_BARCODE_DECODING", - "StageArray": [ - { - "DeblurModes": [ - { - "Mode": "DM_DEEP_ANALYSIS" - } - ], - "Stage": "SST_DECODE_BARCODES" - } - ] - } - ] - } - ], - "CaptureVisionTemplates": [ - { - "ImageROIProcessingNameArray": [ - "roi_default" - ], - "Name": "ReadDotcode" - } - ], - "ImageParameterOptions": [ - { - "ApplicableStages": [ - { - "GrayscaleTransformationModes": [ - { - "Mode": "GTM_INVERTED" - } - ], - "Stage": "SST_TRANSFORM_GRAYSCALE" - }, - { - "BinarizationModes": [ - { - "BlockSizeX": 9, - "BlockSizeY": 9, - "EnableFillBinaryVacancy": 0, - "Mode": "BM_LOCAL_BLOCK", - "ThresholdCompensation": 20 - }, - { - "BlockSizeX": 15, - "BlockSizeY": 15, - "EnableFillBinaryVacancy": 0, - "Mode": "BM_LOCAL_BLOCK", - "MorphOperation": "open", - "MorphOperationKernelSizeX": 3, - "MorphOperationKernelSizeY": 3, - "MorphShape": "Ellipse" - }, - { - "BlockSizeX": 15, - "BlockSizeY": 15, - "EnableFillBinaryVacancy": 0, - "Mode": "BM_LOCAL_BLOCK", - "ThresholdCompensation": 20 - } - ], - "Stage": "SST_BINARIZE_IMAGE" - }, - { - "Stage": "SST_DETECT_TEXTURE", - "TextureDetectionModes": [ - { - "Mode": "TDM_SKIP" - } - ] - } - ], - "Name": "IP_1" - } - ], - "TargetROIDefOptions": [ - { - "Name": "roi_default", - "TaskSettingNameArray": [ - "BR_1" - ] - } - ] -} \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDIndustrial.json b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDIndustrial.json deleted file mode 100644 index c07ecd7a..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDIndustrial.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "BarcodeReaderTaskSettingOptions": [ - { - "BarcodeFormatIds": ["BF_CODE_128", "BF_CODE_39", "BF_ITF", "BF_MATRIX_25", "BF_USPSINTELLIGENTMAIL"], - "ExpectedBarcodesCount": 1, - "Name": "task_read_single_barcode", - "SectionArray": [ - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_REGION_PREDETECTION" - }, - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_BARCODE_LOCALIZATION", - "StageArray": [ - { - "LocalizationModes": [ - { - "Mode": "LM_SCAN_DIRECTLY", - "ScanDirection": 2 - }, - { - "Mode": "LM_CONNECTED_BLOCKS" - } - ], - "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" - } - ] - }, - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_BARCODE_DECODING", - "StageArray": [ - { - "DeblurModes": [ - { - "Mode": "DM_BASED_ON_LOC_BIN" - }, - { - "Mode": "DM_DIRECT_BINARIZATION" - }, - { - "Mode": "DM_DEEP_ANALYSIS" - } - ], - "Stage": "SST_DECODE_BARCODES" - } - ] - } - ] - } - ], - "CaptureVisionTemplates": [ - { - "ImageROIProcessingNameArray": [ - "roi_read_single_barcode" - ], - "Name": "ReadOneDIndustrial" - } - ], - "ImageParameterOptions": [ - { - "ApplicableStages": [ - { - "BinarizationModes": [ - { - "BlockSizeX": 27, - "BlockSizeY": 27, - "EnableFillBinaryVacancy": 0, - "Mode": "BM_LOCAL_BLOCK" - } - ], - "Stage": "SST_BINARIZE_IMAGE" - } - ], - "Name": "ip_read_single_barcode" - } - ], - "TargetROIDefOptions": [ - { - "Name": "roi_read_single_barcode", - "TaskSettingNameArray": [ - "task_read_single_barcode" - ] - } - ] -} \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDRetail.json b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDRetail.json deleted file mode 100644 index d69905f7..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadOneDRetail.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "BarcodeReaderTaskSettingOptions": [ - { - "BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E"], - "ExpectedBarcodesCount": 0, - "Name": "task_read_single_barcode", - "SectionArray": [ - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_REGION_PREDETECTION" - }, - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_BARCODE_LOCALIZATION", - "StageArray": [ - { - "LocalizationModes": [ - { - "Mode": "LM_SCAN_DIRECTLY", - "ScanDirection": 2 - }, - { - "Mode": "LM_CONNECTED_BLOCKS" - } - ], - "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" - } - ] - }, - { - "ImageParameterName": "ip_read_single_barcode", - "Section": "ST_BARCODE_DECODING", - "StageArray": [ - { - "DeblurModes": [ - { - "Mode": "DM_BASED_ON_LOC_BIN" - }, - { - "Mode": "DM_DIRECT_BINARIZATION" - }, - { - "Mode": "DM_DEEP_ANALYSIS" - } - ], - "Stage": "SST_DECODE_BARCODES" - } - ] - } - ] - } - ], - "CaptureVisionTemplates": [ - { - "ImageROIProcessingNameArray": [ - "roi_read_single_barcode" - ], - "Name": "ReadOneDRetail" - } - ], - "ImageParameterOptions": [ - { - "ApplicableStages": [ - { - "BinarizationModes": [ - { - "BlockSizeX": 27, - "BlockSizeY": 27, - "EnableFillBinaryVacancy": 0, - "Mode": "BM_LOCAL_BLOCK" - } - ], - "Stage": "SST_BINARIZE_IMAGE" - } - ], - "Name": "ip_read_single_barcode" - } - ], - "TargetROIDefOptions": [ - { - "Name": "roi_read_single_barcode", - "TaskSettingNameArray": [ - "task_read_single_barcode" - ] - } - ] -} \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/cigarette-dotcode.png b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/cigarette-dotcode.png deleted file mode 100644 index 8c7e481a..00000000 Binary files a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/cigarette-dotcode.png and /dev/null differ diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/dpm.png b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/dpm.png deleted file mode 100644 index c847bb96..00000000 Binary files a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/dpm.png and /dev/null differ diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.css b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.css deleted file mode 100644 index fed0ca90..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.css +++ /dev/null @@ -1,78 +0,0 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -html, -body { - width: 100%; - height: 100%; - font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif; -} - -.container { - width: 100%; - height: 100%; -} - -.container header { - width: 100%; - height: 50px; - background-color: #202020; - color: #ffffff; - font-size: 21px; - text-align: center; - line-height: 50px; -} - -.container .content { - width: 100%; - height: calc(100% - 50px); - padding: 20px 20px 16px 20px; -} - -.container .content .templates { - width: 100%; - height: 20%; - display: flex; - justify-content: space-between; - flex-wrap: wrap; -} - -.container .content .templates .template { - width: 45%; - height: 40%; - display: flex; - justify-content: start; - align-items: center; - background-color: #F5F5F5; - border: 1px solid #AAAAAA; - border-radius: 4px; - color: #323234; - font-size: 16px; - padding-right: 5px; -} - -.container .content .templates .template .radio { - height: 100%; - width: 40px; - display: flex; - justify-content: center; - align-items: center; -} - -.container .content .templates .template .title { - flex: 1; -} - -.container .content .templates .dpm { - font-size: 14px; - border-color: #323234; -} - -.container .content .barcode-scanner-view { - width: 100%; - height: 80%; - background-color: #CFCFCF; -} \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html b/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html deleted file mode 100644 index 1c69159f..00000000 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - Use Customized Template with BarcodeScanner - - - - - - - - -
-
Use Customized Template
-
-
- - - - -
-
-
-
- - - - - \ No newline at end of file diff --git a/foundational-api-samples/hello-world/README.md b/foundational-api-samples/hello-world/README.md deleted file mode 100644 index e62b6fad..00000000 --- a/foundational-api-samples/hello-world/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# The Hello World Sample Set - -As you have already gone through the [user guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html?ver=11.2.4000#hello-world---simplest-implementation), you may have come across some basic "Hello World" code that can help you create a simple web application using our SDK quickly. - -In this set of samples, we will revisit the "Hello World" code and show how to implement it using some popular frameworks, such as Angular, React, and Vue. - -Let's now go through each of the samples. - -## Hello World - -In this example, you will learn the minimum codes required to initialize and set up the SDK. - -Let's quickly break down the methods used in order: - -- `Dynamsoft.License.LicenseManager.initLicense()`: This method initializes the license for using the SDK in the application. -- `Dynamsoft.CVR.CaptureVisionRouter.createInstance()`: This method creates a `CaptureVisionRouter` object `cvRouter` which controls the entire process in three steps: - - **Retrieve Images from the Image Source** - - `cvRouter` connects to the image source through the [`Image Source Adapter`](https://www.dynamsoft.com/capture-vision/docs/core/architecture/input.html#image-source-adapter?lang=js) interface with the method `setInput()`. - ```js - cvRouter.setInput(cameraEnhancer); - ``` - > The image source in our case is a CameraEnhancer object created with `Dynamsoft.DCE.CameraEnhancer.createInstance(view)` - - **Coordinate Image-Processing Tasks** - - The coordination happens behind the scenes. `cvRouter` starts the process by specifying a preset template "ReadSingleBarcode" with the method `startCapturing()`. - ```js - cvRouter.startCapturing("ReadSingleBarcode"); - ``` - - **Dispatch Results to Listening Objects** - - The processing results are returned through the [`CapturedResultReceiver`](https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js) interface. The `CapturedResultReceiver` object `resultReceiver` is registered to `cvRouter` via the method `addResultReceiver()`. - ```js - cvRouter.addResultReceiver(resultReceiver); - ``` - - Also note that reading from video is extremely fast and there could be many duplicate results. We can use a `MultiFrameResultCrossFilter` object with result deduplication enabled to filter out the duplicate results. The object is registered to `cvRouter` via the method `addResultFilter()`. - ```js - cvRouter.addResultFilter(filter); - ``` - -> Read more on [Capture Vision Router](https://www.dynamsoft.com/capture-vision/docs/core/architecture/?lang=js). - -## Hello World - Read Barcodes from an Image - -The second sample processes static images and returns barcode results. - -In this sample, an event listener is set up so that the SDK decodes any images that the user uploads. - -When working with the CaptureVisionRouter class for single image processing, the main method to use is [`capture`](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/single-image-processing.html?lang=js), You can find more details about this method at the link above. - -## Hello World in Angular - -Read more in the README under "angular". - -## Hello World in Blazor - -Read more in the README under "blazor". - -## Hello World in Electron - -Read more in the README under "electron". - -## Hello World in Next.js - -Read more in the README under "next". - -## Hello World in NuxtJS - -Read more in the README under "nuxt". - -## Hello World in PWA - -Read more in the README under "pwa". - -## Hello World in React - -Read more in the README under "react". - -## Hello World in React using Hooks - -Read more in the README under "react-hooks". - -## Hello World in Svelte - -Read more in the README under "svelte". - -## Hello World in Vue - -Read more in the README under "vue". - -## Hello World with RequireJS - -This sample shows how to use the SDK in a web page based on RequireJS. - -## Hello World with ES6 - -This sample shows how to use the SDK in a web page based on ES6 (also known as ECMAScript 2015 or ECMAScript 6). - -## Hello World with WebView - -Read more in the README under "webview". - -## Support - -If you have any questions, feel free to [contact Dynamsoft support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme). diff --git a/foundational-api-samples/hello-world/hello-world.html b/foundational-api-samples/hello-world/hello-world.html deleted file mode 100644 index d574108a..00000000 --- a/foundational-api-samples/hello-world/hello-world.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - Dynamsoft Barcode Reader Sample - Hello World (Decode via Camera) - - - -

Hello World (Decode via Camera)

-
- Results:
-
- - - - - - - - \ No newline at end of file diff --git a/foundational-api-samples/hello-world/react/.gitignore b/foundational-api-samples/hello-world/react/.gitignore deleted file mode 100644 index 4d29575d..00000000 --- a/foundational-api-samples/hello-world/react/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/foundational-api-samples/hello-world/react/README.md b/foundational-api-samples/hello-world/react/README.md deleted file mode 100644 index 2ce4798f..00000000 --- a/foundational-api-samples/hello-world/react/README.md +++ /dev/null @@ -1,411 +0,0 @@ -# Hello World Sample for React - -[React](https://reactjs.org/) is a JavaScript library meant explicitly for creating interactive UIs. Follow this guide to learn how to implement [Dynamsoft Barcode Reader JavaScript SDK](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (hereafter called "the library") into a React application. Note that in this sample we will use `TypeScript` and define components as classes. Also, there is another sample `react-hooks` using `Hooks` in React. - -In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000](https://www.npmjs.com/package/dynamsoft-barcode-reader-bundle/v/11.2.4000). - -> Note: -> -> If you’re looking to integrate DBR-JS into a framework that we don't yet have a sample, don't worry! We have a [comprehensive guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-in-framework.html) that provides detailed instruction and best practices for a seamless integration into any frameworks! -> -> Additionally, we're here to help! Please don't hesitate to [contact us](#Support) for any support or questions you might have. - -## Official Sample - -* Hello World in React - Source Code - -## Preparation - -Make sure you have [node](https://nodejs.org/) installed. `node 16.20.1` and `react 18.2.0` are used in the example below. - -## Quick Start - -```cmd -npm install -npm start -``` -Then open http://localhost:3000/ to view the sample app. - -## Creating the sample project - -In this section, we will be creating a React application utilizing the Dynamsoft Barcode Reader bundle sdk. - -We'll be exploring how you could create a page that not only enables barcode scanning via a webcam or a built-in camera, but also decode barcodes from local images. - -By the end of this guide, you'll have a good understanding of the SDK and be ready to discover more ways to use it! - -### Create a Bootstrapped Raw React Application with TypeScript - -```cmd -npx create-react-app my-app --template typescript -``` - -### **CD** to the root directory of the application and install necessary libraries - -```cmd -cd my-app -npm install dynamsoft-barcode-reader-bundle@11.2.4000 -E -``` - -## Start to implement - -### Add file "dynamsoft.config.ts" at the root of the app to configure libraries - -```typescript -/* /src/dynamsoft.config.ts */ -import { CoreModule } from "dynamsoft-core"; -import { LicenseManager } from "dynamsoft-license"; -import "dynamsoft-barcode-reader"; - -// Configures the paths where the .wasm files and other necessary resources for modules are located. -CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; - -/** LICENSE ALERT - README - * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. - */ - -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); - -/** - * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. - * Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license. - * For more information, see https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html?ver=11.2.4000&cVer=true#specify-the-license&utm_source=samples or contact support@dynamsoft.com. - * LICENSE ALERT - THE END - */ - -// Optional. Preload .wasm file for reading barcodes. It will save time on the initial decoding by skipping the resource loading. -CoreModule.loadWasm(); -``` - -> Note: -> -> * `initLicense()` specify a license key to use the library. You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=sample&product=dbr&package=js to get your own trial license good for 30 days. -> * `engineResourcePaths` tells the library where to get the necessary resources at runtime. - - -### Build directory structure - -* Create a directory `components` under `/src/`, and then create two other directories, `VideoCapture` and `ImageCapture` under `/components/`. - -### Create and edit the `VideoCapture` component - -* Create `VideoCapture.tsx` under `/src/components/VideoCapture/`. The `VideoCapture` component helps decode barcodes via camera. - -* In `VideoCapture.tsx`, add code for initializing and destroying some instances. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample). - -```tsx -/* /src/components/VideoCapture/VideoCapture.tsx */ -import React from "react"; -import "../../dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import { CameraEnhancer, CameraView } from "dynamsoft-camera-enhancer"; -import { CaptureVisionRouter } from "dynamsoft-capture-vision-router"; -import { MultiFrameResultCrossFilter } from "dynamsoft-utility"; -import "./VideoCapture.css"; - -const componentDestroyedErrorMsg = "VideoCapture Component Destroyed"; - -class VideoCapture extends React.Component { - state = { - resultText: "" - }; - cameraViewContainer: React.RefObject = React.createRef(); - - resolveInit?: () => void; - pInit: Promise = new Promise((r) => (this.resolveInit = r)); - isDestroyed = false; - - cvRouter?: CaptureVisionRouter; - cameraEnhancer?: CameraEnhancer; - - async componentDidMount() { - try { - // Create a `CameraView` instance for UI control and a `CameraEnhancer` instance for camera control. - const cameraView = await CameraView.createInstance(); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } // Check if component is destroyed after every async - - this.cameraEnhancer = await CameraEnhancer.createInstance(cameraView); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - - // Get default UI and append it to DOM. - this.cameraViewContainer.current!.append(cameraView.getUIElement()); - - // Create a `CaptureVisionRouter` instance and set `CameraEnhancer` instance as its image source. - this.cvRouter = await CaptureVisionRouter.createInstance(); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - this.cvRouter.setInput(this.cameraEnhancer); - - // Define a callback for results. - this.cvRouter.addResultReceiver({ - onDecodedBarcodesReceived: (result) => { - if (!result.barcodeResultItems.length) return; - - let _resultText = ""; - console.log(result); - for (let item of result.barcodeResultItems) { - _resultText += `${item.formatString}: ${item.text}\n\n`; - } - this.setState({resultText: _resultText}) - }, - }); - - // Filter out unchecked and duplicate results. - const filter = new MultiFrameResultCrossFilter(); - // Filter out unchecked barcodes. - filter.enableResultCrossVerification("barcode", true); - // Filter out duplicate barcodes within 3 seconds. - filter.enableResultDeduplication("barcode", true); - await this.cvRouter.addResultFilter(filter); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - - // Open camera and start scanning single barcode. - await this.cameraEnhancer.open(); - cameraView.setScanLaserVisible(true); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - await this.cvRouter.startCapturing("ReadSingleBarcode"); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - } catch (ex: any) { - if ((ex as Error)?.message === componentDestroyedErrorMsg) { - console.log(componentDestroyedErrorMsg); - } else { - let errMsg = ex.message || ex; - console.error(ex); - alert(errMsg); - } - } - - // Resolve pInit promise once initialization is complete. - this.resolveInit!(); - } - - async componentWillUnmount() { - this.isDestroyed = true; - try { - // Wait for the pInit to complete before disposing resources. - await this.pInit; - this.cvRouter?.dispose(); - this.cameraEnhancer?.dispose(); - } catch (_) {} - } - - render() { - return ( -
-
-
- Results: -
{this.state.resultText}
-
- ); - } -} - -export default VideoCapture; -``` - -> Note: -> -> * The component should never update (check the code for `shouldComponentUpdate()`) so that events bound to the UI stay valid. -> * Also, during 'development', React executes setup and cleanup phases twice in [Strict Mode](https://react.dev/reference/react/StrictMode). To ensure proper functioning of VideoCapture in development, it's advised to avoid using Strict Mode for this component. -> However, if you're still interested on using Strict Mode, we do have a workaround available. Please contact our [support team](#Support) for further assistance. -> * If you're looking to customize the UI, the UI customization feature are provided by the auxiliary SDK "Dynamsoft Camera Enhancer". For more details, refer to our [User Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html#customizing-the-ui) - -### Create and edit the `ImageCapture` component - -* Create `ImageCapture.tsx` under `/src/components/ImageCapture/`. The `ImageCapture` component helps decode barcodes in an image. - -* In `ImageCapture.tsx`, add code for initializing and destroying the `CaptureVisionRouter` instance. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample). - -```tsx -/* /src/components/ImageCapture/ImageCapture.tsx */ -import React, { ChangeEvent } from "react"; -import "../../dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import { EnumCapturedResultItemType } from "dynamsoft-core"; -import type { BarcodeResultItem } from "dynamsoft-barcode-reader"; -import { CaptureVisionRouter } from "dynamsoft-capture-vision-router"; -import "./ImageCapture.css"; - -class ImageCapture extends React.Component { - resultsContainer: React.RefObject = React.createRef(); - - pCvRouter: Promise | null = null; - isDestroyed = false; - - async captureImage(e: ChangeEvent) { - let files = [...(e.target.files as any as File[])]; - e.target.value = ""; // reset input - this.resultsContainer.current!.innerText = ""; - - try { - const cvRouter = await (this.pCvRouter = this.pCvRouter || CaptureVisionRouter.createInstance()); - if (this.isDestroyed) return; - - for (let file of files) { - // Decode selected image with 'ReadBarcodes_ReadRateFirst' template. - const result = await cvRouter.capture(file, "ReadBarcodes_ReadRateFirst"); - console.log(result); - if (this.isDestroyed) return; - - // Print file name if there's multiple files - if (files.length > 1) { - this.resultsContainer.current!.innerText += `\n${file.name}:\n`; - } - for (let _item of result.items) { - if (_item.type !== EnumCapturedResultItemType.CRIT_BARCODE) { - continue; // check if captured result item is a barcode - } - let item = _item as BarcodeResultItem; - this.resultsContainer.current!.innerText += item.text + "\n"; - } - // If no items are found, display that no barcode was detected - if (!result.items.length) this.resultsContainer.current!.innerText += "No barcode found\n"; - } - } catch (ex: any) { - let errMsg = ex.message || ex; - console.error(ex); - alert(errMsg); - } - } - - async componentWillUnmount() { - this.isDestroyed = true; - if (this.pCvRouter) { - try { - (await this.pCvRouter).dispose(); - } catch (_) {} - } - } - - render() { - return ( -
-
- -
-
-
- ); - } -} - -export default ImageCapture; -``` - -### Add the `VideoCapture` and `ImageCapture` component to `App.tsx` - -* On `/src/App.tsx`, we will edit the component so that it offers buttons to switch components between `VideoCapture` and `ImageCapture`. - -* Add following code to `App.tsx`. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample). - -```tsx -/* src/App.tsx */ -import React from "react"; -import reactLogo from "./assets/logo.svg"; -import "./dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import VideoCapture from "./components/VideoCapture/VideoCapture"; -import ImageCapture from "./components/ImageCapture/ImageCapture"; -import "./App.css"; - -enum Modes { - VIDEO_CAPTURE = "video", - IMAGE_CAPTURE = "image", -} - -class App extends React.Component { - state = { - mode: Modes.VIDEO_CAPTURE, - }; - - showVideoCapture = () => { - this.setState({ - mode: Modes.VIDEO_CAPTURE, - }); - }; - - showImageCapture = () => { - this.setState({ - mode: Modes.IMAGE_CAPTURE, - }); - }; - - render() { - return ( -
-
-

Hello World for React

- logo -
-
- - -
-
{this.state.mode === Modes.VIDEO_CAPTURE ? : }
-
- ); - } -} - -export default App; -``` - -* Try running the project. - -```cmd -npm start -``` - -If you have followed all the steps correctly, you should now have a functioning page that allows you to scan barcodes from a webcam or a built-in camera. Additionally, if you want to decode a local image, you can click the `Decode Image` button and select the image you want to decode. Any barcodes that are detected will be displayed in a dialog. - -## Development server - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -## Build - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information. - -## Support - -If you have any questions, feel free to [contact Dynamsoft support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme). diff --git a/foundational-api-samples/hello-world/react/package.json b/foundational-api-samples/hello-world/react/package.json deleted file mode 100644 index 7b079c7f..00000000 --- a/foundational-api-samples/hello-world/react/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "dbrjs-react-sample", - "version": "0.1.0", - "private": true, - "homepage": "./", - "dependencies": { - "@testing-library/jest-dom": "^5.17.0", - "@testing-library/react": "^13.4.0", - "@testing-library/user-event": "^13.5.0", - "@types/jest": "^27.5.2", - "@types/node": "^16.18.98", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "dynamsoft-barcode-reader-bundle": "11.2.4000", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-scripts": "5.0.1", - "typescript": "^4.9.5", - "web-vitals": "^2.1.4" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/foundational-api-samples/hello-world/react/public/favicon.ico b/foundational-api-samples/hello-world/react/public/favicon.ico deleted file mode 100644 index a11777cc..00000000 Binary files a/foundational-api-samples/hello-world/react/public/favicon.ico and /dev/null differ diff --git a/foundational-api-samples/hello-world/react/public/index.html b/foundational-api-samples/hello-world/react/public/index.html deleted file mode 100644 index a88f5d4d..00000000 --- a/foundational-api-samples/hello-world/react/public/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - Hello World for React - Dynamsoft Barcode Reader Sample - - - -
- - - diff --git a/foundational-api-samples/hello-world/react/public/logo192.png b/foundational-api-samples/hello-world/react/public/logo192.png deleted file mode 100644 index fc44b0a3..00000000 Binary files a/foundational-api-samples/hello-world/react/public/logo192.png and /dev/null differ diff --git a/foundational-api-samples/hello-world/react/public/logo512.png b/foundational-api-samples/hello-world/react/public/logo512.png deleted file mode 100644 index a4e47a65..00000000 Binary files a/foundational-api-samples/hello-world/react/public/logo512.png and /dev/null differ diff --git a/foundational-api-samples/hello-world/react/public/manifest.json b/foundational-api-samples/hello-world/react/public/manifest.json deleted file mode 100644 index fc7ce894..00000000 --- a/foundational-api-samples/hello-world/react/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} \ No newline at end of file diff --git a/foundational-api-samples/hello-world/react/public/robots.txt b/foundational-api-samples/hello-world/react/public/robots.txt deleted file mode 100644 index e9e57dc4..00000000 --- a/foundational-api-samples/hello-world/react/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/foundational-api-samples/hello-world/react/src/App.css b/foundational-api-samples/hello-world/react/src/App.css deleted file mode 100644 index 4b1f0cbc..00000000 --- a/foundational-api-samples/hello-world/react/src/App.css +++ /dev/null @@ -1,50 +0,0 @@ -.hello-world-page { - text-align: center; -} -.title { - display: flex; - justify-content: center; - align-items: center; - margin-top: 20px; -} -.title .title-logo { - width: 60px; - height: 60px; - animation: retate 5s infinite linear; -} -.buttons-container { - text-align: center; - margin: 20px auto; -} -.buttons-container button { - display: inline-block; - border: 1px solid black; - padding: 5px 15px; - background-color: transparent; - cursor: pointer; -} -.buttons-container button:first-child { - border-top-left-radius: 10px; - border-bottom-left-radius: 10px; - border-right: transparent; -} -.buttons-container button:nth-child(2) { - border-top-right-radius: 10px; - border-bottom-right-radius: 10px; - border-left: transparent; -} - -@media screen and (max-width: 800px) { - .buttons-container { - width: 70%; - } -} - -@keyframes retate { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/foundational-api-samples/hello-world/react/src/App.tsx b/foundational-api-samples/hello-world/react/src/App.tsx deleted file mode 100644 index 4aa79319..00000000 --- a/foundational-api-samples/hello-world/react/src/App.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React from "react"; -import reactLogo from "./assets/logo.svg"; -import "./dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import VideoCapture from "./components/VideoCapture/VideoCapture"; -import ImageCapture from "./components/ImageCapture/ImageCapture"; -import "./App.css"; - -enum Modes { - VIDEO_CAPTURE = "video", - IMAGE_CAPTURE = "image", -} - -class App extends React.Component { - state = { - mode: Modes.VIDEO_CAPTURE, - }; - - showVideoCapture = () => { - this.setState({ - mode: Modes.VIDEO_CAPTURE, - }); - }; - - showImageCapture = () => { - this.setState({ - mode: Modes.IMAGE_CAPTURE, - }); - }; - - render() { - return ( -
-
-

Hello World for React

- logo -
-
- - -
-
{this.state.mode === Modes.VIDEO_CAPTURE ? : }
-
- ); - } -} - -export default App; diff --git a/foundational-api-samples/hello-world/react/src/assets/logo.svg b/foundational-api-samples/hello-world/react/src/assets/logo.svg deleted file mode 100644 index 9dfc1c05..00000000 --- a/foundational-api-samples/hello-world/react/src/assets/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.css b/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.css deleted file mode 100644 index 03da581c..00000000 --- a/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.css +++ /dev/null @@ -1,20 +0,0 @@ -.image-capture-container { - width: 100%; - height: 100%; - font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, - Courier New, monospace; -} - -.image-capture-container .input-container { - width: 80%; - height: 100%; - display: flex; - justify-content: center; - border: 1px solid black; - margin: 0 auto; -} - -.image-capture-container .results { - margin-top: 20px; - height: 100%; -} diff --git a/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.tsx b/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.tsx deleted file mode 100644 index 2bc8253a..00000000 --- a/foundational-api-samples/hello-world/react/src/components/ImageCapture/ImageCapture.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React, { ChangeEvent } from "react"; -import "../../dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import { EnumCapturedResultItemType, CaptureVisionRouter } from "dynamsoft-barcode-reader-bundle"; -import type { BarcodeResultItem } from "dynamsoft-barcode-reader-bundle"; -import "./ImageCapture.css"; - -class ImageCapture extends React.Component { - resultsContainer: React.RefObject = React.createRef(); - - pCvRouter: Promise | null = null; - isDestroyed = false; - - async captureImage(e: ChangeEvent) { - let files = [...(e.target.files as any as File[])]; - e.target.value = ""; // reset input - this.resultsContainer.current!.innerText = ""; - - try { - const cvRouter = await (this.pCvRouter = this.pCvRouter || CaptureVisionRouter.createInstance()); - if (this.isDestroyed) return; - - for (let file of files) { - // Decode selected image with 'ReadBarcodes_ReadRateFirst' template. - const result = await cvRouter.capture(file, "ReadBarcodes_ReadRateFirst"); - console.log(result); - if (this.isDestroyed) return; - - // Print file name if there's multiple files - if (files.length > 1) { - this.resultsContainer.current!.innerText += `\n${file.name}:\n`; - } - for (let _item of result.items) { - if (_item.type !== EnumCapturedResultItemType.CRIT_BARCODE) { - continue; // check if captured result item is a barcode - } - let item = _item as BarcodeResultItem; - this.resultsContainer.current!.innerText += item.text + "\n"; - } - // If no items are found, display that no barcode was detected - if (!result.items.length) this.resultsContainer.current!.innerText += "No barcode found\n"; - } - } catch (ex: any) { - let errMsg = ex.message || ex; - console.error(ex); - alert(errMsg); - } - } - - async componentWillUnmount() { - this.isDestroyed = true; - if (this.pCvRouter) { - try { - (await this.pCvRouter).dispose(); - } catch (_) {} - } - } - - render() { - return ( -
-
- -
-
-
- ); - } -} - -export default ImageCapture; diff --git a/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.css b/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.css deleted file mode 100644 index 9bfe13ad..00000000 --- a/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.css +++ /dev/null @@ -1,6 +0,0 @@ -.results { - width: 100%; - height: 10vh; - overflow: auto; - white-space: pre-wrap; -} diff --git a/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.tsx b/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.tsx deleted file mode 100644 index 62eb118b..00000000 --- a/foundational-api-samples/hello-world/react/src/components/VideoCapture/VideoCapture.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import React from "react"; -import "../../dynamsoft.config"; // import side effects. The license, engineResourcePath, so on. -import { CameraEnhancer, CameraView, CaptureVisionRouter, MultiFrameResultCrossFilter } from "dynamsoft-barcode-reader-bundle"; -import "./VideoCapture.css"; - -const componentDestroyedErrorMsg = "VideoCapture Component Destroyed"; - -class VideoCapture extends React.Component { - state = { - resultText: "", - }; - cameraViewContainer: React.RefObject = React.createRef(); - - resolveInit?: () => void; - pInit: Promise = new Promise((r) => (this.resolveInit = r)); - isDestroyed = false; - - cvRouter?: CaptureVisionRouter; - cameraEnhancer?: CameraEnhancer; - - async componentDidMount() { - try { - // Create a `CameraEnhancer` instance for camera control and a `CameraView` instance for UI control. - const cameraView = await CameraView.createInstance(); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } // Check if component is destroyed after every async - - this.cameraEnhancer = await CameraEnhancer.createInstance(cameraView); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - - // Get default UI and append it to DOM. - this.cameraViewContainer.current!.append(cameraView.getUIElement()); - - // Create a `CaptureVisionRouter` instance and set `CameraEnhancer` instance as its image source. - this.cvRouter = await CaptureVisionRouter.createInstance(); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - this.cvRouter.setInput(this.cameraEnhancer); - - // Define a callback for results. - this.cvRouter.addResultReceiver({ - onDecodedBarcodesReceived: (result) => { - if (!result.barcodeResultItems.length) return; - - let _resultText = ""; - console.log(result); - for (let item of result.barcodeResultItems) { - _resultText += `${item.formatString}: ${item.text}\n\n`; - } - this.setState({ resultText: _resultText }); - }, - }); - - // Filter out unchecked and duplicate results. - const filter = new MultiFrameResultCrossFilter(); - // Filter out unchecked barcodes. - filter.enableResultCrossVerification("barcode", true); - // Filter out duplicate barcodes within 3 seconds. - filter.enableResultDeduplication("barcode", true); - await this.cvRouter.addResultFilter(filter); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - - // Open camera and start scanning barcode. - await this.cameraEnhancer.open(); - cameraView.setScanLaserVisible(true); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - await this.cvRouter.startCapturing("ReadBarcodes_SpeedFirst"); - if (this.isDestroyed) { - throw Error(componentDestroyedErrorMsg); - } - } catch (ex: any) { - if ((ex as Error)?.message === componentDestroyedErrorMsg) { - console.log(componentDestroyedErrorMsg); - } else { - let errMsg = ex.message || ex; - console.error(ex); - alert(errMsg); - } - } - - // Resolve pInit promise once initialization is complete. - this.resolveInit!(); - } - - async componentWillUnmount() { - this.isDestroyed = true; - try { - // Wait for the pInit to complete before disposing resources. - await this.pInit; - this.cvRouter?.dispose(); - this.cameraEnhancer?.dispose(); - } catch (_) {} - } - - render() { - return ( -
-
-
- Results: -
{this.state.resultText}
-
- ); - } -} - -export default VideoCapture; diff --git a/foundational-api-samples/hello-world/react/src/dynamsoft.config.ts b/foundational-api-samples/hello-world/react/src/dynamsoft.config.ts deleted file mode 100644 index bc2c9faa..00000000 --- a/foundational-api-samples/hello-world/react/src/dynamsoft.config.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CoreModule } from "dynamsoft-barcode-reader-bundle"; -import { LicenseManager } from "dynamsoft-barcode-reader-bundle"; - -// Configures the paths where the .wasm files and other necessary resources for modules are located. -CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; - -/** LICENSE ALERT - README - * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. - */ - -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); - -/** - * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. - * Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license. - * For more information, see https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html?ver=11.2.4000&cVer=true#specify-the-license&utm_source=samples or contact support@dynamsoft.com. - * LICENSE ALERT - THE END - */ - -// Optional. Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. -CoreModule.loadWasm(); diff --git a/foundational-api-samples/hello-world/react/src/index.css b/foundational-api-samples/hello-world/react/src/index.css deleted file mode 100644 index e9927237..00000000 --- a/foundational-api-samples/hello-world/react/src/index.css +++ /dev/null @@ -1,11 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", - "Droid Sans", "Helvetica Neue", sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; -} diff --git a/foundational-api-samples/hello-world/react/src/index.tsx b/foundational-api-samples/hello-world/react/src/index.tsx deleted file mode 100644 index 625b6731..00000000 --- a/foundational-api-samples/hello-world/react/src/index.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import ReactDOM from "react-dom/client"; -import "./index.css"; -import App from "./App"; - -const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement); -root.render(); diff --git a/foundational-api-samples/hello-world/react/src/logo.svg b/foundational-api-samples/hello-world/react/src/logo.svg deleted file mode 100644 index 9dfc1c05..00000000 --- a/foundational-api-samples/hello-world/react/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/foundational-api-samples/hello-world/react/src/react-app-env.d.ts b/foundational-api-samples/hello-world/react/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5f..00000000 --- a/foundational-api-samples/hello-world/react/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/foundational-api-samples/hello-world/react/tsconfig.json b/foundational-api-samples/hello-world/react/tsconfig.json deleted file mode 100644 index a273b0cf..00000000 --- a/foundational-api-samples/hello-world/react/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": [ - "src" - ] -} diff --git a/foundational-api-samples/use-case/README.md b/foundational-api-samples/use-case/README.md deleted file mode 100644 index a9a95536..00000000 --- a/foundational-api-samples/use-case/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## Read Barcodes and Fill Form Fields - -It's difficult to type long text on mobile devices, but if that text is encoded in a barcode, we can use the SDK to read the barcode and automatically enter the text. - -The following sample demonstrates how to utilize the SDK to fill out form fields. - -* Read Barcodes and Fill Form Fields - Demo -* Read Barcodes and Fill Form Fields - Source Code - -## Read the PDF417 Barcode on the Driver's License - -The PDF417 barcode on an AAMVA-compatible driver's license contains information encoded following the DL/ID Card Design Standard. Together with a simple parse function, we can use the SDK to read and extract the information. - -The following official sample shows how to use the SDK to read and extract driver's license information. - -* Read the PDF417 Barcode on the Driver's License - Demo -* Read the PDF417 Barcode on the Driver's License - Source Code - -Also, see [Driver's License Scanner SDK for Mobile and Web](https://www.dynamsoft.com/use-cases/driver-license/). - -## Read Barcodes via Camera and Show Result Texts on the Video - -When the SDK picks up a barcode in a video stream, it will automatically highlight it with a built-in style. But it is also possible to show the barcode text on the video with the help of the function `convertToPageCoordinates()` or `convertToClientCoordinates()`. - -The following official sample shows how to show the result texts on the video. - -* Read barcodes via camera and show result texts on the video - Demo -* Read barcodes via camera and show result texts on the video - Source Code - -## Locate an Item via Barcode - -Searching for a specific item among numerous identical boxes can be challenging. However, with the Dynamsoft Barcode Reader (DBR) SDK, we can locate the item quickly by scanning through the barcodes. - -The following sample demonstrates how to utilize the SDK to find an item using a barcode among many barcodes. - -Additionally, this sample demonstrates how to utilize the SDK to fill out form fields, creating a custom UI with [Dynamsoft Camera Enhancer (DCE)](https://www.dynamsoft.com/camera-enhancer/docs/core/introduction/index.html), and using DCE to draw shapes/images on the CameraView to create indicators for each barcode that has been detected! - -* Locate an Item with Barcode - Demo -* Locate an Item with Barcode - Source Code - -## Read the GS1-AI Barcode and Parse it - -GS1-AI barcodes contain standardized information such as product ID (GTIN), expiration date, batch/lot number, and more, encoded using specific Application Identifiers (AIs). - -This sample demonstrates how to scan a GS1 Application Identifier (AI) barcode using the Dynamsoft Barcode Reader SDK and parse its structured data. - -* Read the GS1-AI Barcode and Parse It - Demo -* Read the GS1-AI Barcode and Parse It - Source Code - -## Support - -If you have any questions, feel free to [contact Dynamsoft](https://www.dynamsoft.com/company/contact/). diff --git a/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html b/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html deleted file mode 100644 index 8cdef5d1..00000000 --- a/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - Dynamsoft Barcode Reader Sample - Fill Forms with Dynamsoft Barcode Reader - - - - -

Fill Forms with Dynamsoft Barcode Reader

-
-

Click each input box to fill in!

- - - -
- - - - - - - - - \ No newline at end of file diff --git a/foundational-api-samples/use-case/read-a-drivers-license/SampleDriversLicense.jpg b/foundational-api-samples/use-case/read-a-drivers-license/SampleDriversLicense.jpg deleted file mode 100644 index 7bb877f7..00000000 Binary files a/foundational-api-samples/use-case/read-a-drivers-license/SampleDriversLicense.jpg and /dev/null differ diff --git a/frameworks/README.md b/frameworks/README.md new file mode 100644 index 00000000..c7812e62 --- /dev/null +++ b/frameworks/README.md @@ -0,0 +1,42 @@ +# Frameworks samples + +This directory contains framework-specific examples demonstrating how to integrate the Dynamsoft Barcode Reader (JavaScript edition) into common web and hybrid frameworks. Each framework folder contains one or more runnable sub-examples (for example, scan-using-foundational-api and/or scan-using-rtu-api) showing practical integration patterns. + +## Sample list + +- [angular/](./angular/) — Angular examples. +- [blazor/](./blazor/) — Blazor (.NET) examples. +- [capacitor/](./capacitor/) — Capacitor mobile hybrid examples. +- [electron/](./electron/) — Electron desktop examples. +- [es6/](./es6/) — Plain ES6 module examples. +- [native-ts/](./native-ts/) — Native TypeScript examples. +- [next/](./next/) — Next.js examples. +- [nuxt/](./nuxt/) — Nuxt examples. +- [pwa/](./pwa/) — Progressive Web App examples. +- [react/](./react/) — React examples. +- [requirejs/](./requirejs/) — RequireJS (AMD) examples. +- [svelte/](./svelte/) — Svelte examples. +- [vue/](./vue/) — Vue examples. +- [webview/](./webview/) — Native WebView examples for Android/iOS. + +## Quick start + +1. Browse into a framework subfolder and choose a subexample, e.g.: + ```cmd + cd react/scan-using-rtu-api + ``` +1. Follow the subexample README for exact steps. Typical commands: + ```cmd + - npm install + - npm run dev (or npm start / npm run build per the subexample) + ``` +2. Open the local dev URL shown in the terminal (ensure you use localhost or HTTPS for camera access). + +## Notes + +- Serve examples via the framework dev server or a local HTTP server; opening files directly (file://) may break module loading or camera permissions. +- Camera and microphone access require a secure context (https or localhost). +- A trial license is included for short-term testing; request a longer trial from Dynamsoft for extended evaluation. +- For general instructions, license info and API docs, see the repository root README.md. + +If a sub-example provides a README, follow it for platform-specific details and additional troubleshooting tips. \ No newline at end of file diff --git a/frameworks/angular/README.md b/frameworks/angular/README.md new file mode 100644 index 00000000..97e5d706 --- /dev/null +++ b/frameworks/angular/README.md @@ -0,0 +1,23 @@ +# Angular samples + +This directory contains Angular-based examples demonstrating how to use the Dynamsoft Barcode Reader (JavaScript edition) in Angular projects. + +**Included examples** + +- scan-using-foundational-api/ — Example using the foundational API. +- scan-using-rtu-api/ — Example using the RTU API. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (typically: npm install && npm run start or ng serve). + +## Notes + +- Run examples via the framework dev server. Opening files directly may break module loading or camera access. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/angular/.editorconfig b/frameworks/angular/scan-using-foundational-api/.editorconfig similarity index 100% rename from foundational-api-samples/hello-world/angular/.editorconfig rename to frameworks/angular/scan-using-foundational-api/.editorconfig diff --git a/foundational-api-samples/hello-world/angular/.gitignore b/frameworks/angular/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/angular/.gitignore rename to frameworks/angular/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/angular/README.md b/frameworks/angular/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/angular/README.md rename to frameworks/angular/scan-using-foundational-api/README.md index 53abb5d8..7a922945 100644 --- a/foundational-api-samples/hello-world/angular/README.md +++ b/frameworks/angular/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000`](ht ## Official sample -* Hello World in Angular - Source Code +* Hello World in Angular - Source Code ## Preparation Make sure you have [node](https://nodejs.org/) and [Angular CLI](https://cli.angular.io/) installed. diff --git a/foundational-api-samples/hello-world/angular/angular.json b/frameworks/angular/scan-using-foundational-api/angular.json similarity index 100% rename from foundational-api-samples/hello-world/angular/angular.json rename to frameworks/angular/scan-using-foundational-api/angular.json diff --git a/foundational-api-samples/hello-world/angular/package.json b/frameworks/angular/scan-using-foundational-api/package.json similarity index 100% rename from foundational-api-samples/hello-world/angular/package.json rename to frameworks/angular/scan-using-foundational-api/package.json diff --git a/foundational-api-samples/hello-world/angular/src/app/app.component.css b/frameworks/angular/scan-using-foundational-api/src/app/app.component.css similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/app.component.css rename to frameworks/angular/scan-using-foundational-api/src/app/app.component.css diff --git a/foundational-api-samples/hello-world/angular/src/app/app.component.html b/frameworks/angular/scan-using-foundational-api/src/app/app.component.html similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/app.component.html rename to frameworks/angular/scan-using-foundational-api/src/app/app.component.html diff --git a/foundational-api-samples/hello-world/angular/src/app/app.component.ts b/frameworks/angular/scan-using-foundational-api/src/app/app.component.ts similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/app.component.ts rename to frameworks/angular/scan-using-foundational-api/src/app/app.component.ts diff --git a/foundational-api-samples/hello-world/angular/src/app/dynamsoft.config.ts b/frameworks/angular/scan-using-foundational-api/src/app/dynamsoft.config.ts similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/dynamsoft.config.ts rename to frameworks/angular/scan-using-foundational-api/src/app/dynamsoft.config.ts diff --git a/foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.css b/frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.css similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.css rename to frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.css diff --git a/foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.html b/frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.html similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.html rename to frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.html diff --git a/foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.ts b/frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.ts similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/image-capture/image-capture.component.ts rename to frameworks/angular/scan-using-foundational-api/src/app/image-capture/image-capture.component.ts diff --git a/foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.css b/frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.css similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.css rename to frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.css diff --git a/foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.html b/frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.html similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.html rename to frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.html diff --git a/foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.ts b/frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.ts similarity index 100% rename from foundational-api-samples/hello-world/angular/src/app/video-capture/video-capture.component.ts rename to frameworks/angular/scan-using-foundational-api/src/app/video-capture/video-capture.component.ts diff --git a/foundational-api-samples/hello-world/angular/src/assets/.gitkeep b/frameworks/angular/scan-using-foundational-api/src/assets/.gitkeep similarity index 100% rename from foundational-api-samples/hello-world/angular/src/assets/.gitkeep rename to frameworks/angular/scan-using-foundational-api/src/assets/.gitkeep diff --git a/foundational-api-samples/hello-world/angular/src/favicon.ico b/frameworks/angular/scan-using-foundational-api/src/favicon.ico similarity index 100% rename from foundational-api-samples/hello-world/angular/src/favicon.ico rename to frameworks/angular/scan-using-foundational-api/src/favicon.ico diff --git a/foundational-api-samples/hello-world/angular/src/index.html b/frameworks/angular/scan-using-foundational-api/src/index.html similarity index 100% rename from foundational-api-samples/hello-world/angular/src/index.html rename to frameworks/angular/scan-using-foundational-api/src/index.html diff --git a/foundational-api-samples/hello-world/angular/src/main.ts b/frameworks/angular/scan-using-foundational-api/src/main.ts similarity index 100% rename from foundational-api-samples/hello-world/angular/src/main.ts rename to frameworks/angular/scan-using-foundational-api/src/main.ts diff --git a/foundational-api-samples/hello-world/angular/src/styles.css b/frameworks/angular/scan-using-foundational-api/src/styles.css similarity index 100% rename from foundational-api-samples/hello-world/angular/src/styles.css rename to frameworks/angular/scan-using-foundational-api/src/styles.css diff --git a/foundational-api-samples/hello-world/angular/tsconfig.app.json b/frameworks/angular/scan-using-foundational-api/tsconfig.app.json similarity index 100% rename from foundational-api-samples/hello-world/angular/tsconfig.app.json rename to frameworks/angular/scan-using-foundational-api/tsconfig.app.json diff --git a/foundational-api-samples/hello-world/angular/tsconfig.json b/frameworks/angular/scan-using-foundational-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/angular/tsconfig.json rename to frameworks/angular/scan-using-foundational-api/tsconfig.json diff --git a/foundational-api-samples/hello-world/angular/tsconfig.spec.json b/frameworks/angular/scan-using-foundational-api/tsconfig.spec.json similarity index 100% rename from foundational-api-samples/hello-world/angular/tsconfig.spec.json rename to frameworks/angular/scan-using-foundational-api/tsconfig.spec.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/.editorconfig b/frameworks/angular/scan-using-rtu-api/.editorconfig similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/.editorconfig rename to frameworks/angular/scan-using-rtu-api/.editorconfig diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/.gitignore b/frameworks/angular/scan-using-rtu-api/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/.gitignore rename to frameworks/angular/scan-using-rtu-api/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/README.md b/frameworks/angular/scan-using-rtu-api/README.md similarity index 70% rename from barcode-scanner-api-samples/scan-single-barcode/angular/README.md rename to frameworks/angular/scan-using-rtu-api/README.md index e31e5b7c..c6056438 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/angular/README.md +++ b/frameworks/angular/scan-using-rtu-api/README.md @@ -26,7 +26,7 @@ Then open your browser at http://localhost:4200 to view the sample app. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/angular.json b/frameworks/angular/scan-using-rtu-api/angular.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/angular.json rename to frameworks/angular/scan-using-rtu-api/angular.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/package.json b/frameworks/angular/scan-using-rtu-api/package.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/package.json rename to frameworks/angular/scan-using-rtu-api/package.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.css b/frameworks/angular/scan-using-rtu-api/src/app/app.component.css similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.css rename to frameworks/angular/scan-using-rtu-api/src/app/app.component.css diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.html b/frameworks/angular/scan-using-rtu-api/src/app/app.component.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.html rename to frameworks/angular/scan-using-rtu-api/src/app/app.component.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.ts b/frameworks/angular/scan-using-rtu-api/src/app/app.component.ts similarity index 94% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.ts rename to frameworks/angular/scan-using-rtu-api/src/app/app.component.ts index a9941b96..db4bb914 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.component.ts +++ b/frameworks/angular/scan-using-rtu-api/src/app/app.component.ts @@ -20,7 +20,7 @@ export class AppComponent { // Specify where to render the scanner UI // If container is not specified, the UI will take up the full screen - container: this.barcodeScannerViewRef.nativeElement, + container: this.barcodeScannerViewRef.nativeElement, // Specify the path for the definition file "barcode-scanner.ui.xml" for the scanner view. uiPath: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.2.4000/dist/ui/barcode-scanner.ui.xml", @@ -46,7 +46,7 @@ export class AppComponent { alert(result.barcodeResults[0].text); } } - async ngOnDestroy(): Promise { + async ngOnDestroy(): Promise { // Dispose of the barcode scanner when the component unmounts this.barcodeScanner?.dispose(); } diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.config.ts b/frameworks/angular/scan-using-rtu-api/src/app/app.config.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.config.ts rename to frameworks/angular/scan-using-rtu-api/src/app/app.config.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.routes.ts b/frameworks/angular/scan-using-rtu-api/src/app/app.routes.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/app/app.routes.ts rename to frameworks/angular/scan-using-rtu-api/src/app/app.routes.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/index.html b/frameworks/angular/scan-using-rtu-api/src/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/index.html rename to frameworks/angular/scan-using-rtu-api/src/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/main.ts b/frameworks/angular/scan-using-rtu-api/src/main.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/main.ts rename to frameworks/angular/scan-using-rtu-api/src/main.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/src/styles.css b/frameworks/angular/scan-using-rtu-api/src/styles.css similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/src/styles.css rename to frameworks/angular/scan-using-rtu-api/src/styles.css diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.app.json b/frameworks/angular/scan-using-rtu-api/tsconfig.app.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.app.json rename to frameworks/angular/scan-using-rtu-api/tsconfig.app.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.json b/frameworks/angular/scan-using-rtu-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.json rename to frameworks/angular/scan-using-rtu-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.spec.json b/frameworks/angular/scan-using-rtu-api/tsconfig.spec.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/angular/tsconfig.spec.json rename to frameworks/angular/scan-using-rtu-api/tsconfig.spec.json diff --git a/frameworks/blazor/README.md b/frameworks/blazor/README.md new file mode 100644 index 00000000..f2dc0dec --- /dev/null +++ b/frameworks/blazor/README.md @@ -0,0 +1,23 @@ +# Blazor samples + +This directory contains Blazor examples demonstrating how to integrate the Dynamsoft Barcode Reader (JavaScript edition) into Blazor apps. + +**Included examples** + +- scan-using-foundational-api/ — Blazor example with JS interop for video/image decoding. +- scan-using-rtu-api/ — RTU API demo for Blazor. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (may require dotnet/SDK commands or npm for static assets). + +## Notes + +- Some examples use JS interop; run the app via dotnet or the provided launch configuration. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/blazor/.gitignore b/frameworks/blazor/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/blazor/.gitignore rename to frameworks/blazor/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/blazor/README.md b/frameworks/blazor/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/blazor/README.md rename to frameworks/blazor/scan-using-foundational-api/README.md index 9133328f..e942c4fe 100644 --- a/foundational-api-samples/hello-world/blazor/README.md +++ b/frameworks/blazor/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000`](ht ## Official Sample -* Hello World in Blazor - Source Code +* Hello World in Blazor - Source Code ## Preparation diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/App.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/App.razor similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/App.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/App.razor diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/BlazorApp.csproj b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/BlazorApp.csproj similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/BlazorApp.csproj rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/BlazorApp.csproj diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/MainLayout.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/MainLayout.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/MainLayout.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/MainLayout.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/MainLayout.razor.css b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/MainLayout.razor.css similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/MainLayout.razor.css rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/MainLayout.razor.css diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/NavMenu.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/NavMenu.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/NavMenu.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/NavMenu.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/NavMenu.razor.css b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/NavMenu.razor.css similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Layout/NavMenu.razor.css rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Layout/NavMenu.razor.css diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/DecodeImage.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/DecodeImage.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/DecodeImage.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/DecodeImage.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/DecodeVideo.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/DecodeVideo.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/DecodeVideo.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/DecodeVideo.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/Home.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/Home.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Pages/Home.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Pages/Home.razor diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/Program.cs b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Program.cs similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/Program.cs rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Program.cs diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/Properties/launchSettings.json b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Properties/launchSettings.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/Properties/launchSettings.json rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/Properties/launchSettings.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/_Imports.razor b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/_Imports.razor similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/_Imports.razor rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/_Imports.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/app.css b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/app.css similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/app.css rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/app.css diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css.map b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css.map similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css.map rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/css/bootstrap/bootstrap.min.css.map diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeImage.js b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/decodeImage.js similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeImage.js rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/decodeImage.js diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/favicon.png b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/favicon.png similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/favicon.png rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/favicon.png diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/icon-192.png b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/icon-192.png similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/icon-192.png rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/icon-192.png diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html b/frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/index.html similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html rename to frameworks/blazor/scan-using-foundational-api/hello-world-blazor/BlazorApp/wwwroot/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/.gitignore b/frameworks/blazor/scan-using-rtu-api/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/.gitignore rename to frameworks/blazor/scan-using-rtu-api/.gitignore diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/App.razor b/frameworks/blazor/scan-using-rtu-api/App.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/App.razor rename to frameworks/blazor/scan-using-rtu-api/App.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/BlazorApp.csproj b/frameworks/blazor/scan-using-rtu-api/BlazorApp.csproj similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/BlazorApp.csproj rename to frameworks/blazor/scan-using-rtu-api/BlazorApp.csproj diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/Layout/MainLayout.razor b/frameworks/blazor/scan-using-rtu-api/Layout/MainLayout.razor similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/Layout/MainLayout.razor rename to frameworks/blazor/scan-using-rtu-api/Layout/MainLayout.razor diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/Pages/Home.razor b/frameworks/blazor/scan-using-rtu-api/Pages/Home.razor similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/Pages/Home.razor rename to frameworks/blazor/scan-using-rtu-api/Pages/Home.razor diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Program.cs b/frameworks/blazor/scan-using-rtu-api/Program.cs similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Program.cs rename to frameworks/blazor/scan-using-rtu-api/Program.cs diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Properties/launchSettings.json b/frameworks/blazor/scan-using-rtu-api/Properties/launchSettings.json similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/Properties/launchSettings.json rename to frameworks/blazor/scan-using-rtu-api/Properties/launchSettings.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/README.md b/frameworks/blazor/scan-using-rtu-api/README.md similarity index 64% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/README.md rename to frameworks/blazor/scan-using-rtu-api/README.md index c25f2ed6..becc2dda 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/blazor/README.md +++ b/frameworks/blazor/scan-using-rtu-api/README.md @@ -10,7 +10,7 @@ This sample demonstrates how to use the `BarcodeScanner` API from the [Dynamsoft ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please refer check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/_Imports.razor b/frameworks/blazor/scan-using-rtu-api/_Imports.razor similarity index 100% rename from foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/_Imports.razor rename to frameworks/blazor/scan-using-rtu-api/_Imports.razor diff --git a/barcode-scanner-api-samples/scan-single-barcode/blazor/wwwroot/index.html b/frameworks/blazor/scan-using-rtu-api/wwwroot/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/blazor/wwwroot/index.html rename to frameworks/blazor/scan-using-rtu-api/wwwroot/index.html diff --git a/frameworks/capacitor/README.md b/frameworks/capacitor/README.md new file mode 100644 index 00000000..4b3e675c --- /dev/null +++ b/frameworks/capacitor/README.md @@ -0,0 +1,22 @@ +# Capacitor samples + +This directory contains Capacitor examples showing how to use the Dynamsoft Barcode Reader in hybrid mobile apps (Android / iOS) via Capacitor. + +**Included example** + +- scan-using-rtu-api/ — Capacitor project illustrating RTU API usage. + +## Quick start + +1. Change to the example directory, e.g.: + + ```bash + cd scan-using-rtu-api + ``` + +2. Follow the subexample README for platform-specific setup (npm install, capacitor sync, open Android Studio/Xcode). + +## Notes + +- Mobile platform setup is required to run native apps. See the subexample README for exact steps. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/README.md b/frameworks/capacitor/scan-using-rtu-api/README.md similarity index 79% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/README.md rename to frameworks/capacitor/scan-using-rtu-api/README.md index 24b2f172..841a54be 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/capacitor/README.md +++ b/frameworks/capacitor/scan-using-rtu-api/README.md @@ -36,7 +36,7 @@ Notice we add camera permission in `AndroidManifest.xml` and `Info.plist`. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/.gitignore b/frameworks/capacitor/scan-using-rtu-api/android/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/.gitignore rename to frameworks/capacitor/scan-using-rtu-api/android/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/.gitignore b/frameworks/capacitor/scan-using-rtu-api/android/app/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/.gitignore rename to frameworks/capacitor/scan-using-rtu-api/android/app/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/build.gradle b/frameworks/capacitor/scan-using-rtu-api/android/app/build.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/build.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/app/build.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/capacitor.build.gradle b/frameworks/capacitor/scan-using-rtu-api/android/app/capacitor.build.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/capacitor.build.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/app/capacitor.build.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/proguard-rules.pro b/frameworks/capacitor/scan-using-rtu-api/android/app/proguard-rules.pro similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/proguard-rules.pro rename to frameworks/capacitor/scan-using-rtu-api/android/app/proguard-rules.pro diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/frameworks/capacitor/scan-using-rtu-api/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/AndroidManifest.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/AndroidManifest.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/AndroidManifest.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/AndroidManifest.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/java/com/dynamsoft/dbrjs/MainActivity.java b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/java/com/dynamsoft/dbrjs/MainActivity.java similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/java/com/dynamsoft/dbrjs/MainActivity.java rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/java/com/dynamsoft/dbrjs/MainActivity.java diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-hdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-hdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-hdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-hdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-mdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-mdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-mdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-mdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xxhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xxhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xxhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xxxhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-land-xxxhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-land-xxxhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-hdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-hdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-hdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-hdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-mdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-mdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-mdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-mdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xxhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xxhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xxhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xxxhdpi/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-port-xxxhdpi/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-port-xxxhdpi/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable/ic_launcher_background.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable/ic_launcher_background.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable/splash.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable/splash.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/drawable/splash.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/drawable/splash.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/layout/activity_main.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/layout/activity_main.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/layout/activity_main.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/layout/activity_main.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/ic_launcher_background.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/ic_launcher_background.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/ic_launcher_background.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/ic_launcher_background.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/strings.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/strings.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/strings.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/strings.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/styles.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/styles.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/values/styles.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/values/styles.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/xml/file_paths.xml b/frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/xml/file_paths.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/main/res/xml/file_paths.xml rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/main/res/xml/file_paths.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/frameworks/capacitor/scan-using-rtu-api/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java rename to frameworks/capacitor/scan-using-rtu-api/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/build.gradle b/frameworks/capacitor/scan-using-rtu-api/android/build.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/build.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/build.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/capacitor.settings.gradle b/frameworks/capacitor/scan-using-rtu-api/android/capacitor.settings.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/capacitor.settings.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/capacitor.settings.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle.properties b/frameworks/capacitor/scan-using-rtu-api/android/gradle.properties similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle.properties rename to frameworks/capacitor/scan-using-rtu-api/android/gradle.properties diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle/wrapper/gradle-wrapper.jar b/frameworks/capacitor/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle/wrapper/gradle-wrapper.jar rename to frameworks/capacitor/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.jar diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle/wrapper/gradle-wrapper.properties b/frameworks/capacitor/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradle/wrapper/gradle-wrapper.properties rename to frameworks/capacitor/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.properties diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradlew b/frameworks/capacitor/scan-using-rtu-api/android/gradlew similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradlew rename to frameworks/capacitor/scan-using-rtu-api/android/gradlew diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradlew.bat b/frameworks/capacitor/scan-using-rtu-api/android/gradlew.bat similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/gradlew.bat rename to frameworks/capacitor/scan-using-rtu-api/android/gradlew.bat diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/settings.gradle b/frameworks/capacitor/scan-using-rtu-api/android/settings.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/settings.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/settings.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/android/variables.gradle b/frameworks/capacitor/scan-using-rtu-api/android/variables.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/android/variables.gradle rename to frameworks/capacitor/scan-using-rtu-api/android/variables.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/capacitor.config.json b/frameworks/capacitor/scan-using-rtu-api/capacitor.config.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/capacitor.config.json rename to frameworks/capacitor/scan-using-rtu-api/capacitor.config.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/index.ts b/frameworks/capacitor/scan-using-rtu-api/index.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/index.ts rename to frameworks/capacitor/scan-using-rtu-api/index.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/.gitignore b/frameworks/capacitor/scan-using-rtu-api/ios/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/.gitignore rename to frameworks/capacitor/scan-using-rtu-api/ios/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App.xcodeproj/project.pbxproj b/frameworks/capacitor/scan-using-rtu-api/ios/App/App.xcodeproj/project.pbxproj similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App.xcodeproj/project.pbxproj rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App.xcodeproj/project.pbxproj diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frameworks/capacitor/scan-using-rtu-api/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/AppDelegate.swift b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/AppDelegate.swift similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/AppDelegate.swift rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/AppDelegate.swift diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Contents.json b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Contents.json rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Base.lproj/LaunchScreen.storyboard diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Base.lproj/Main.storyboard b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Base.lproj/Main.storyboard similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Base.lproj/Main.storyboard rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Base.lproj/Main.storyboard diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Info.plist b/frameworks/capacitor/scan-using-rtu-api/ios/App/App/Info.plist similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/App/Info.plist rename to frameworks/capacitor/scan-using-rtu-api/ios/App/App/Info.plist diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/Podfile b/frameworks/capacitor/scan-using-rtu-api/ios/App/Podfile similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/ios/App/Podfile rename to frameworks/capacitor/scan-using-rtu-api/ios/App/Podfile diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/package.json b/frameworks/capacitor/scan-using-rtu-api/package.json similarity index 94% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/package.json rename to frameworks/capacitor/scan-using-rtu-api/package.json index 120fc430..592e4268 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/capacitor/package.json +++ b/frameworks/capacitor/scan-using-rtu-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-capacitor", + "name": "dbrjs-capacitor-rtu", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/public/index.html b/frameworks/capacitor/scan-using-rtu-api/public/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/public/index.html rename to frameworks/capacitor/scan-using-rtu-api/public/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/rollup.config.mjs b/frameworks/capacitor/scan-using-rtu-api/rollup.config.mjs similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/rollup.config.mjs rename to frameworks/capacitor/scan-using-rtu-api/rollup.config.mjs diff --git a/barcode-scanner-api-samples/scan-single-barcode/capacitor/tsconfig.json b/frameworks/capacitor/scan-using-rtu-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/capacitor/tsconfig.json rename to frameworks/capacitor/scan-using-rtu-api/tsconfig.json diff --git a/frameworks/electron/README.md b/frameworks/electron/README.md new file mode 100644 index 00000000..b07a6f7d --- /dev/null +++ b/frameworks/electron/README.md @@ -0,0 +1,23 @@ +# Electron samples + +This directory contains Electron examples demonstrating desktop apps using the Dynamsoft Barcode Reader (JavaScript edition). + +**Included examples** + +- scan-using-foundational-api/ — Electron demo using foundational API. +- scan-using-rtu-api/ — Electron demo using RTU API. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (typically: npm install && npm run start or npm run electron). + +## Notes + +- Desktop examples may require additional native build steps for packaging. Run via the provided dev command. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/electron/README.md b/frameworks/electron/scan-using-foundational-api/README.md similarity index 98% rename from foundational-api-samples/hello-world/electron/README.md rename to frameworks/electron/scan-using-foundational-api/README.md index 9a3f67a5..a6dd47ed 100644 --- a/foundational-api-samples/hello-world/electron/README.md +++ b/frameworks/electron/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000`](ht ## Official Sample -* Hello World in Electron - Source Code +* Hello World in Electron - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/electron/action.js b/frameworks/electron/scan-using-foundational-api/action.js similarity index 100% rename from foundational-api-samples/hello-world/electron/action.js rename to frameworks/electron/scan-using-foundational-api/action.js diff --git a/foundational-api-samples/hello-world/electron/index.html b/frameworks/electron/scan-using-foundational-api/index.html similarity index 100% rename from foundational-api-samples/hello-world/electron/index.html rename to frameworks/electron/scan-using-foundational-api/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/main.js b/frameworks/electron/scan-using-foundational-api/main.js similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/electron/main.js rename to frameworks/electron/scan-using-foundational-api/main.js diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/package.json b/frameworks/electron/scan-using-foundational-api/package.json similarity index 91% rename from barcode-scanner-api-samples/scan-single-barcode/electron/package.json rename to frameworks/electron/scan-using-foundational-api/package.json index 96e25a02..5f6d1d80 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/electron/package.json +++ b/frameworks/electron/scan-using-foundational-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-electron-sample", + "name": "dbrjs-electron-foundational", "version": "1.2.0", "description": "How to read barcodes from a video input in an Electron App", "main": "main.js", @@ -18,7 +18,7 @@ }, "homepage": "https://github.com/Dynamsoft/barcode-reader-javascript-samples#readme", "devDependencies": { - "electron": "^26.4.1" + "electron": "^33.2.0" }, "dependencies": { "dynamsoft-barcode-reader-bundle": "11.2.4000" diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/style.css b/frameworks/electron/scan-using-foundational-api/style.css similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/electron/style.css rename to frameworks/electron/scan-using-foundational-api/style.css diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/README.md b/frameworks/electron/scan-using-rtu-api/README.md similarity index 68% rename from barcode-scanner-api-samples/scan-single-barcode/electron/README.md rename to frameworks/electron/scan-using-rtu-api/README.md index 5db7f2f3..a9d37870 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/electron/README.md +++ b/frameworks/electron/scan-using-rtu-api/README.md @@ -24,7 +24,7 @@ npm run start ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/action.js b/frameworks/electron/scan-using-rtu-api/action.js similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/electron/action.js rename to frameworks/electron/scan-using-rtu-api/action.js diff --git a/barcode-scanner-api-samples/scan-single-barcode/electron/index.html b/frameworks/electron/scan-using-rtu-api/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/electron/index.html rename to frameworks/electron/scan-using-rtu-api/index.html diff --git a/foundational-api-samples/hello-world/electron/main.js b/frameworks/electron/scan-using-rtu-api/main.js similarity index 100% rename from foundational-api-samples/hello-world/electron/main.js rename to frameworks/electron/scan-using-rtu-api/main.js diff --git a/foundational-api-samples/hello-world/electron/package.json b/frameworks/electron/scan-using-rtu-api/package.json similarity index 91% rename from foundational-api-samples/hello-world/electron/package.json rename to frameworks/electron/scan-using-rtu-api/package.json index 96e25a02..9cbd8e51 100644 --- a/foundational-api-samples/hello-world/electron/package.json +++ b/frameworks/electron/scan-using-rtu-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-electron-sample", + "name": "dbrjs-electron-rtu", "version": "1.2.0", "description": "How to read barcodes from a video input in an Electron App", "main": "main.js", @@ -18,7 +18,7 @@ }, "homepage": "https://github.com/Dynamsoft/barcode-reader-javascript-samples#readme", "devDependencies": { - "electron": "^26.4.1" + "electron": "^33.2.0" }, "dependencies": { "dynamsoft-barcode-reader-bundle": "11.2.4000" diff --git a/foundational-api-samples/hello-world/electron/style.css b/frameworks/electron/scan-using-rtu-api/style.css similarity index 100% rename from foundational-api-samples/hello-world/electron/style.css rename to frameworks/electron/scan-using-rtu-api/style.css diff --git a/frameworks/es6/README.md b/frameworks/es6/README.md new file mode 100644 index 00000000..b6f0e81a --- /dev/null +++ b/frameworks/es6/README.md @@ -0,0 +1,18 @@ +# ES6 samples + +This directory contains plain ES6 module examples demonstrating basic usage of the Dynamsoft Barcode Reader in vanilla JavaScript (ES6 modules). + +**Included examples** + +- scan-using-foundational-api/ — Plain ES6 page using foundational API. +- scan-using-rtu-api/ — ES6 page using RTU API. + +## Quick start + +1. Change to the example directory (or open repository root). +2. Serve files with a local static server and open the HTML page (e.g., python -m http.server or npx http-server). + +## Notes + +- ES6 modules require serving over HTTP; opening files directly in the browser may not work. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/es6.html b/frameworks/es6/scan-using-foundational-api/es6.html similarity index 100% rename from foundational-api-samples/hello-world/es6.html rename to frameworks/es6/scan-using-foundational-api/es6.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/es6.html b/frameworks/es6/scan-using-rtu-api/es6.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/es6.html rename to frameworks/es6/scan-using-rtu-api/es6.html diff --git a/frameworks/native-ts/README.md b/frameworks/native-ts/README.md new file mode 100644 index 00000000..558d624b --- /dev/null +++ b/frameworks/native-ts/README.md @@ -0,0 +1,23 @@ +# Native TypeScript samples + +This directory contains TypeScript-based native examples demonstrating how to use the Dynamsoft Barcode Reader in TypeScript projects. + +**Included examples** + +- scan-using-foundational-api/ — TypeScript example with build config. +- scan-using-rtu-api/ — RTU API example in TypeScript. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for build/run steps (typically: npm install && npm run build / npm run dev). + +## Notes + +- Use the included build tooling (rollup/tsconfig) as described in each subexample. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/native-ts/index.html b/frameworks/native-ts/scan-using-foundational-api/index.html similarity index 100% rename from foundational-api-samples/hello-world/native-ts/index.html rename to frameworks/native-ts/scan-using-foundational-api/index.html diff --git a/foundational-api-samples/hello-world/native-ts/index.ts b/frameworks/native-ts/scan-using-foundational-api/index.ts similarity index 100% rename from foundational-api-samples/hello-world/native-ts/index.ts rename to frameworks/native-ts/scan-using-foundational-api/index.ts diff --git a/foundational-api-samples/hello-world/native-ts/package.json b/frameworks/native-ts/scan-using-foundational-api/package.json similarity index 100% rename from foundational-api-samples/hello-world/native-ts/package.json rename to frameworks/native-ts/scan-using-foundational-api/package.json diff --git a/foundational-api-samples/hello-world/native-ts/rollup.config.mjs b/frameworks/native-ts/scan-using-foundational-api/rollup.config.mjs similarity index 100% rename from foundational-api-samples/hello-world/native-ts/rollup.config.mjs rename to frameworks/native-ts/scan-using-foundational-api/rollup.config.mjs diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/tsconfig.json b/frameworks/native-ts/scan-using-foundational-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/tsconfig.json rename to frameworks/native-ts/scan-using-foundational-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/README.md b/frameworks/native-ts/scan-using-rtu-api/README.md similarity index 68% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/README.md rename to frameworks/native-ts/scan-using-rtu-api/README.md index eb7d5663..abc27be5 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/native-ts/README.md +++ b/frameworks/native-ts/scan-using-rtu-api/README.md @@ -19,7 +19,7 @@ Open `dist/index.html` in your browser. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/index.ts b/frameworks/native-ts/scan-using-rtu-api/index.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/index.ts rename to frameworks/native-ts/scan-using-rtu-api/index.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/package.json b/frameworks/native-ts/scan-using-rtu-api/package.json similarity index 93% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/package.json rename to frameworks/native-ts/scan-using-rtu-api/package.json index 03b5ce56..e58f5b55 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/native-ts/package.json +++ b/frameworks/native-ts/scan-using-rtu-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-capacitor", + "name": "dbrjs-native-ts-rtu", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/public/index.html b/frameworks/native-ts/scan-using-rtu-api/public/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/public/index.html rename to frameworks/native-ts/scan-using-rtu-api/public/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/native-ts/rollup.config.mjs b/frameworks/native-ts/scan-using-rtu-api/rollup.config.mjs similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/native-ts/rollup.config.mjs rename to frameworks/native-ts/scan-using-rtu-api/rollup.config.mjs diff --git a/foundational-api-samples/hello-world/native-ts/tsconfig.json b/frameworks/native-ts/scan-using-rtu-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/native-ts/tsconfig.json rename to frameworks/native-ts/scan-using-rtu-api/tsconfig.json diff --git a/frameworks/next/README.md b/frameworks/next/README.md new file mode 100644 index 00000000..ed5d7deb --- /dev/null +++ b/frameworks/next/README.md @@ -0,0 +1,23 @@ +# Next.js samples + +This directory contains Next.js examples demonstrating how to integrate the Dynamsoft Barcode Reader into Next.js apps. + +**Included example** + +- scan-using-foundational-api/ — Next.js example (Vite/Next dev server). + +## Quick start + +1. Change to the example directory, e.g.: + + ```bash + cd scan-using-foundational-api + + ``` + +2. Follow the subexample README for exact steps (typically: npm install && npm run dev). + +## Notes + +- Run via the framework dev server to ensure module loading and camera access work correctly. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/next/.eslintrc.json b/frameworks/next/scan-using-foundational-api/.eslintrc.json similarity index 100% rename from foundational-api-samples/hello-world/next/.eslintrc.json rename to frameworks/next/scan-using-foundational-api/.eslintrc.json diff --git a/foundational-api-samples/hello-world/next/.gitignore b/frameworks/next/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/next/.gitignore rename to frameworks/next/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/next/README.md b/frameworks/next/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/next/README.md rename to frameworks/next/scan-using-foundational-api/README.md index a7c1a253..3e9cad23 100644 --- a/foundational-api-samples/hello-world/next/README.md +++ b/frameworks/next/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000`](ht ## Official Sample -* Hello World in Next.js - Source Code +* Hello World in Next.js - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/next/app/favicon.ico b/frameworks/next/scan-using-foundational-api/app/favicon.ico similarity index 100% rename from foundational-api-samples/hello-world/next/app/favicon.ico rename to frameworks/next/scan-using-foundational-api/app/favicon.ico diff --git a/foundational-api-samples/hello-world/next/app/globals.css b/frameworks/next/scan-using-foundational-api/app/globals.css similarity index 100% rename from foundational-api-samples/hello-world/next/app/globals.css rename to frameworks/next/scan-using-foundational-api/app/globals.css diff --git a/foundational-api-samples/hello-world/next/app/layout.tsx b/frameworks/next/scan-using-foundational-api/app/layout.tsx similarity index 100% rename from foundational-api-samples/hello-world/next/app/layout.tsx rename to frameworks/next/scan-using-foundational-api/app/layout.tsx diff --git a/foundational-api-samples/hello-world/next/app/page.css b/frameworks/next/scan-using-foundational-api/app/page.css similarity index 100% rename from foundational-api-samples/hello-world/next/app/page.css rename to frameworks/next/scan-using-foundational-api/app/page.css diff --git a/foundational-api-samples/hello-world/next/app/page.tsx b/frameworks/next/scan-using-foundational-api/app/page.tsx similarity index 100% rename from foundational-api-samples/hello-world/next/app/page.tsx rename to frameworks/next/scan-using-foundational-api/app/page.tsx diff --git a/foundational-api-samples/hello-world/next/components/ImageCapture/ImageCapture.css b/frameworks/next/scan-using-foundational-api/components/ImageCapture/ImageCapture.css similarity index 100% rename from foundational-api-samples/hello-world/next/components/ImageCapture/ImageCapture.css rename to frameworks/next/scan-using-foundational-api/components/ImageCapture/ImageCapture.css diff --git a/foundational-api-samples/hello-world/next/components/ImageCapture/ImageCapture.tsx b/frameworks/next/scan-using-foundational-api/components/ImageCapture/ImageCapture.tsx similarity index 100% rename from foundational-api-samples/hello-world/next/components/ImageCapture/ImageCapture.tsx rename to frameworks/next/scan-using-foundational-api/components/ImageCapture/ImageCapture.tsx diff --git a/foundational-api-samples/hello-world/next/components/VideoCapture/VideoCapture.css b/frameworks/next/scan-using-foundational-api/components/VideoCapture/VideoCapture.css similarity index 100% rename from foundational-api-samples/hello-world/next/components/VideoCapture/VideoCapture.css rename to frameworks/next/scan-using-foundational-api/components/VideoCapture/VideoCapture.css diff --git a/foundational-api-samples/hello-world/next/components/VideoCapture/VideoCapture.tsx b/frameworks/next/scan-using-foundational-api/components/VideoCapture/VideoCapture.tsx similarity index 100% rename from foundational-api-samples/hello-world/next/components/VideoCapture/VideoCapture.tsx rename to frameworks/next/scan-using-foundational-api/components/VideoCapture/VideoCapture.tsx diff --git a/foundational-api-samples/hello-world/next/dynamsoft.config.ts b/frameworks/next/scan-using-foundational-api/dynamsoft.config.ts similarity index 100% rename from foundational-api-samples/hello-world/next/dynamsoft.config.ts rename to frameworks/next/scan-using-foundational-api/dynamsoft.config.ts diff --git a/foundational-api-samples/hello-world/next/next.config.mjs b/frameworks/next/scan-using-foundational-api/next.config.mjs similarity index 100% rename from foundational-api-samples/hello-world/next/next.config.mjs rename to frameworks/next/scan-using-foundational-api/next.config.mjs diff --git a/foundational-api-samples/hello-world/next/package.json b/frameworks/next/scan-using-foundational-api/package.json similarity index 95% rename from foundational-api-samples/hello-world/next/package.json rename to frameworks/next/scan-using-foundational-api/package.json index 1ad66cb5..a52ba588 100644 --- a/foundational-api-samples/hello-world/next/package.json +++ b/frameworks/next/scan-using-foundational-api/package.json @@ -11,7 +11,7 @@ "dependencies": { "react": "^18", "react-dom": "^18", - "next": "^14.2.3", + "next": "14.2.3", "dynamsoft-barcode-reader-bundle": "11.2.4000" }, "devDependencies": { diff --git a/foundational-api-samples/hello-world/next/public/next.svg b/frameworks/next/scan-using-foundational-api/public/next.svg similarity index 100% rename from foundational-api-samples/hello-world/next/public/next.svg rename to frameworks/next/scan-using-foundational-api/public/next.svg diff --git a/foundational-api-samples/hello-world/next/public/vercel.svg b/frameworks/next/scan-using-foundational-api/public/vercel.svg similarity index 100% rename from foundational-api-samples/hello-world/next/public/vercel.svg rename to frameworks/next/scan-using-foundational-api/public/vercel.svg diff --git a/foundational-api-samples/hello-world/next/tsconfig.json b/frameworks/next/scan-using-foundational-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/next/tsconfig.json rename to frameworks/next/scan-using-foundational-api/tsconfig.json diff --git a/frameworks/nuxt/README.md b/frameworks/nuxt/README.md new file mode 100644 index 00000000..82f70306 --- /dev/null +++ b/frameworks/nuxt/README.md @@ -0,0 +1,22 @@ +# Nuxt samples + +This directory contains Nuxt examples demonstrating use of the Dynamsoft Barcode Reader in Nuxt projects. + +**Included example** + +- scan-using-foundational-api/ — Nuxt example using foundational API. + +## Quick start + +1. Change to the example directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (typically: npm install && npm run dev). + +## Notes + +- Use the Nuxt dev server for best results; opening static files directly is not recommended. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/nuxt/.gitignore b/frameworks/nuxt/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/nuxt/.gitignore rename to frameworks/nuxt/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/nuxt/README.md b/frameworks/nuxt/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/nuxt/README.md rename to frameworks/nuxt/scan-using-foundational-api/README.md index 9a20076c..003c4582 100644 --- a/foundational-api-samples/hello-world/nuxt/README.md +++ b/frameworks/nuxt/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000`](ht ## Official Sample -* Hello World in Nuxt - Source Code +* Hello World in Nuxt - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/nuxt/app.vue b/frameworks/nuxt/scan-using-foundational-api/app.vue similarity index 100% rename from foundational-api-samples/hello-world/nuxt/app.vue rename to frameworks/nuxt/scan-using-foundational-api/app.vue diff --git a/foundational-api-samples/hello-world/nuxt/assets/logo.svg b/frameworks/nuxt/scan-using-foundational-api/assets/logo.svg similarity index 100% rename from foundational-api-samples/hello-world/nuxt/assets/logo.svg rename to frameworks/nuxt/scan-using-foundational-api/assets/logo.svg diff --git a/foundational-api-samples/hello-world/nuxt/assets/main.css b/frameworks/nuxt/scan-using-foundational-api/assets/main.css similarity index 100% rename from foundational-api-samples/hello-world/nuxt/assets/main.css rename to frameworks/nuxt/scan-using-foundational-api/assets/main.css diff --git a/foundational-api-samples/hello-world/nuxt/components/ImageCapture.client.vue b/frameworks/nuxt/scan-using-foundational-api/components/ImageCapture.client.vue similarity index 100% rename from foundational-api-samples/hello-world/nuxt/components/ImageCapture.client.vue rename to frameworks/nuxt/scan-using-foundational-api/components/ImageCapture.client.vue diff --git a/foundational-api-samples/hello-world/nuxt/components/VideoCapture.client.vue b/frameworks/nuxt/scan-using-foundational-api/components/VideoCapture.client.vue similarity index 100% rename from foundational-api-samples/hello-world/nuxt/components/VideoCapture.client.vue rename to frameworks/nuxt/scan-using-foundational-api/components/VideoCapture.client.vue diff --git a/foundational-api-samples/hello-world/nuxt/dynamsoft.config.ts b/frameworks/nuxt/scan-using-foundational-api/dynamsoft.config.ts similarity index 97% rename from foundational-api-samples/hello-world/nuxt/dynamsoft.config.ts rename to frameworks/nuxt/scan-using-foundational-api/dynamsoft.config.ts index 744bd1ed..185ff12a 100644 --- a/foundational-api-samples/hello-world/nuxt/dynamsoft.config.ts +++ b/frameworks/nuxt/scan-using-foundational-api/dynamsoft.config.ts @@ -7,9 +7,7 @@ CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); +LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/foundational-api-samples/hello-world/nuxt/nuxt.config.ts b/frameworks/nuxt/scan-using-foundational-api/nuxt.config.ts similarity index 100% rename from foundational-api-samples/hello-world/nuxt/nuxt.config.ts rename to frameworks/nuxt/scan-using-foundational-api/nuxt.config.ts diff --git a/foundational-api-samples/hello-world/nuxt/package.json b/frameworks/nuxt/scan-using-foundational-api/package.json similarity index 94% rename from foundational-api-samples/hello-world/nuxt/package.json rename to frameworks/nuxt/scan-using-foundational-api/package.json index c3f49284..000d468c 100644 --- a/foundational-api-samples/hello-world/nuxt/package.json +++ b/frameworks/nuxt/scan-using-foundational-api/package.json @@ -10,7 +10,7 @@ "postinstall": "nuxt prepare" }, "devDependencies": { - "nuxt": "^3.2.3" + "nuxt": "3.2.3" }, "dependencies": { "dynamsoft-barcode-reader-bundle": "11.2.4000" diff --git a/foundational-api-samples/hello-world/nuxt/public/favicon.ico b/frameworks/nuxt/scan-using-foundational-api/public/favicon.ico similarity index 100% rename from foundational-api-samples/hello-world/nuxt/public/favicon.ico rename to frameworks/nuxt/scan-using-foundational-api/public/favicon.ico diff --git a/foundational-api-samples/hello-world/nuxt/tsconfig.json b/frameworks/nuxt/scan-using-foundational-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/nuxt/tsconfig.json rename to frameworks/nuxt/scan-using-foundational-api/tsconfig.json diff --git a/frameworks/pwa/README.md b/frameworks/pwa/README.md new file mode 100644 index 00000000..46ff2b72 --- /dev/null +++ b/frameworks/pwa/README.md @@ -0,0 +1,23 @@ +# PWA samples + +This directory contains Progressive Web App examples demonstrating how to use Dynamsoft Barcode Reader in PWA contexts. + +**Included examples** + +- scan-using-foundational-api/ (helloworld-pwa.html) — PWA sample pages and service worker. +- scan-using-rtu-api/ — RTU API PWA example. + +## Quick start + +1. Change to the example directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Serve the files over HTTPS or a local dev server and open the provided HTML (service worker requires secure context). + +## Notes + +- PWAs require HTTPS (or localhost) for service worker and camera features. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/pwa/README.md b/frameworks/pwa/scan-using-foundational-api/README.md similarity index 97% rename from foundational-api-samples/hello-world/pwa/README.md rename to frameworks/pwa/scan-using-foundational-api/README.md index 8d80b6b0..3e84e059 100644 --- a/foundational-api-samples/hello-world/pwa/README.md +++ b/frameworks/pwa/scan-using-foundational-api/README.md @@ -12,8 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000](htt ## Official Sample -* Hello World in PWA - Demo -* Hello World in PWA - Source Code +* Hello World in PWA - Source Code ## Preparation diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/dynamsoft-192x192.png b/frameworks/pwa/scan-using-foundational-api/dynamsoft-192x192.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/dynamsoft-192x192.png rename to frameworks/pwa/scan-using-foundational-api/dynamsoft-192x192.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/dynamsoft-512x512.png b/frameworks/pwa/scan-using-foundational-api/dynamsoft-512x512.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/dynamsoft-512x512.png rename to frameworks/pwa/scan-using-foundational-api/dynamsoft-512x512.png diff --git a/foundational-api-samples/hello-world/pwa/helloworld-pwa.html b/frameworks/pwa/scan-using-foundational-api/helloworld-pwa.html similarity index 100% rename from foundational-api-samples/hello-world/pwa/helloworld-pwa.html rename to frameworks/pwa/scan-using-foundational-api/helloworld-pwa.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/helloworld-pwa.json b/frameworks/pwa/scan-using-foundational-api/helloworld-pwa.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/helloworld-pwa.json rename to frameworks/pwa/scan-using-foundational-api/helloworld-pwa.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/service-worker.js b/frameworks/pwa/scan-using-foundational-api/service-worker.js similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/service-worker.js rename to frameworks/pwa/scan-using-foundational-api/service-worker.js diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/README.md b/frameworks/pwa/scan-using-rtu-api/README.md similarity index 64% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/README.md rename to frameworks/pwa/scan-using-rtu-api/README.md index c55a68fd..80d5be59 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/pwa/README.md +++ b/frameworks/pwa/scan-using-rtu-api/README.md @@ -10,7 +10,7 @@ This sample shows how to integrate the `BarcodeScanner` API from the [Dynamsoft ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/foundational-api-samples/hello-world/pwa/dynamsoft-192x192.png b/frameworks/pwa/scan-using-rtu-api/dynamsoft-192x192.png similarity index 100% rename from foundational-api-samples/hello-world/pwa/dynamsoft-192x192.png rename to frameworks/pwa/scan-using-rtu-api/dynamsoft-192x192.png diff --git a/foundational-api-samples/hello-world/pwa/dynamsoft-512x512.png b/frameworks/pwa/scan-using-rtu-api/dynamsoft-512x512.png similarity index 100% rename from foundational-api-samples/hello-world/pwa/dynamsoft-512x512.png rename to frameworks/pwa/scan-using-rtu-api/dynamsoft-512x512.png diff --git a/barcode-scanner-api-samples/scan-single-barcode/pwa/helloworld-pwa.html b/frameworks/pwa/scan-using-rtu-api/helloworld-pwa.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pwa/helloworld-pwa.html rename to frameworks/pwa/scan-using-rtu-api/helloworld-pwa.html diff --git a/foundational-api-samples/hello-world/pwa/helloworld-pwa.json b/frameworks/pwa/scan-using-rtu-api/helloworld-pwa.json similarity index 100% rename from foundational-api-samples/hello-world/pwa/helloworld-pwa.json rename to frameworks/pwa/scan-using-rtu-api/helloworld-pwa.json diff --git a/foundational-api-samples/hello-world/pwa/service-worker.js b/frameworks/pwa/scan-using-rtu-api/service-worker.js similarity index 100% rename from foundational-api-samples/hello-world/pwa/service-worker.js rename to frameworks/pwa/scan-using-rtu-api/service-worker.js diff --git a/frameworks/react/README.md b/frameworks/react/README.md new file mode 100644 index 00000000..88def624 --- /dev/null +++ b/frameworks/react/README.md @@ -0,0 +1,23 @@ +# React samples + +This directory contains React-based examples demonstrating how to use the Dynamsoft Barcode Reader (JavaScript edition) in React projects. + +**Included examples** + +- `scan-using-foundational-api/` — React + TypeScript example using the foundational API. +- `scan-using-rtu-api/` — React example using the RTU API. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (typically: `npm install` && `npm run dev` or `npm run start`). + +## Notes + +- Run examples via the framework dev server. Opening files directly may break module loading or camera access. +- See the repository root `README.md` for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/react-hooks/.gitignore b/frameworks/react/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/.gitignore rename to frameworks/react/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/react-hooks/README.md b/frameworks/react/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/react-hooks/README.md rename to frameworks/react/scan-using-foundational-api/README.md index fbeb6ec5..b3dc8343 100644 --- a/foundational-api-samples/hello-world/react-hooks/README.md +++ b/frameworks/react/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000](htt ## Official Sample -* Hello World in React with Hooks - Source Code +* Hello World in React with Hooks - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/react-hooks/package.json b/frameworks/react/scan-using-foundational-api/package.json similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/package.json rename to frameworks/react/scan-using-foundational-api/package.json diff --git a/foundational-api-samples/hello-world/react-hooks/public/favicon.ico b/frameworks/react/scan-using-foundational-api/public/favicon.ico similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/public/favicon.ico rename to frameworks/react/scan-using-foundational-api/public/favicon.ico diff --git a/foundational-api-samples/hello-world/react-hooks/public/index.html b/frameworks/react/scan-using-foundational-api/public/index.html similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/public/index.html rename to frameworks/react/scan-using-foundational-api/public/index.html diff --git a/foundational-api-samples/hello-world/react-hooks/public/logo192.png b/frameworks/react/scan-using-foundational-api/public/logo192.png similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/public/logo192.png rename to frameworks/react/scan-using-foundational-api/public/logo192.png diff --git a/foundational-api-samples/hello-world/react-hooks/public/logo512.png b/frameworks/react/scan-using-foundational-api/public/logo512.png similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/public/logo512.png rename to frameworks/react/scan-using-foundational-api/public/logo512.png diff --git a/foundational-api-samples/hello-world/react-hooks/public/manifest.json b/frameworks/react/scan-using-foundational-api/public/manifest.json similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/public/manifest.json rename to frameworks/react/scan-using-foundational-api/public/manifest.json diff --git a/foundational-api-samples/hello-world/react-hooks/src/App.css b/frameworks/react/scan-using-foundational-api/src/App.css similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/App.css rename to frameworks/react/scan-using-foundational-api/src/App.css diff --git a/foundational-api-samples/hello-world/react-hooks/src/App.tsx b/frameworks/react/scan-using-foundational-api/src/App.tsx similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/App.tsx rename to frameworks/react/scan-using-foundational-api/src/App.tsx diff --git a/foundational-api-samples/hello-world/react-hooks/src/assets/logo.svg b/frameworks/react/scan-using-foundational-api/src/assets/logo.svg similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/assets/logo.svg rename to frameworks/react/scan-using-foundational-api/src/assets/logo.svg diff --git a/foundational-api-samples/hello-world/react-hooks/src/components/ImageCapture/ImageCapture.css b/frameworks/react/scan-using-foundational-api/src/components/ImageCapture/ImageCapture.css similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/components/ImageCapture/ImageCapture.css rename to frameworks/react/scan-using-foundational-api/src/components/ImageCapture/ImageCapture.css diff --git a/foundational-api-samples/hello-world/react-hooks/src/components/ImageCapture/ImageCapture.tsx b/frameworks/react/scan-using-foundational-api/src/components/ImageCapture/ImageCapture.tsx similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/components/ImageCapture/ImageCapture.tsx rename to frameworks/react/scan-using-foundational-api/src/components/ImageCapture/ImageCapture.tsx diff --git a/foundational-api-samples/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.css b/frameworks/react/scan-using-foundational-api/src/components/VideoCapture/VideoCapture.css similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.css rename to frameworks/react/scan-using-foundational-api/src/components/VideoCapture/VideoCapture.css diff --git a/foundational-api-samples/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx b/frameworks/react/scan-using-foundational-api/src/components/VideoCapture/VideoCapture.tsx similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx rename to frameworks/react/scan-using-foundational-api/src/components/VideoCapture/VideoCapture.tsx diff --git a/foundational-api-samples/hello-world/react-hooks/src/dynamsoft.config.ts b/frameworks/react/scan-using-foundational-api/src/dynamsoft.config.ts similarity index 97% rename from foundational-api-samples/hello-world/react-hooks/src/dynamsoft.config.ts rename to frameworks/react/scan-using-foundational-api/src/dynamsoft.config.ts index 744bd1ed..185ff12a 100644 --- a/foundational-api-samples/hello-world/react-hooks/src/dynamsoft.config.ts +++ b/frameworks/react/scan-using-foundational-api/src/dynamsoft.config.ts @@ -7,9 +7,7 @@ CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); +LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/foundational-api-samples/hello-world/react-hooks/src/index.css b/frameworks/react/scan-using-foundational-api/src/index.css similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/index.css rename to frameworks/react/scan-using-foundational-api/src/index.css diff --git a/foundational-api-samples/hello-world/react-hooks/src/index.tsx b/frameworks/react/scan-using-foundational-api/src/index.tsx similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/index.tsx rename to frameworks/react/scan-using-foundational-api/src/index.tsx diff --git a/foundational-api-samples/hello-world/react-hooks/src/react-app-env.d.ts b/frameworks/react/scan-using-foundational-api/src/react-app-env.d.ts similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/src/react-app-env.d.ts rename to frameworks/react/scan-using-foundational-api/src/react-app-env.d.ts diff --git a/foundational-api-samples/hello-world/react-hooks/tsconfig.json b/frameworks/react/scan-using-foundational-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/react-hooks/tsconfig.json rename to frameworks/react/scan-using-foundational-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/.gitignore b/frameworks/react/scan-using-rtu-api/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/.gitignore rename to frameworks/react/scan-using-rtu-api/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/README.md b/frameworks/react/scan-using-rtu-api/README.md similarity index 70% rename from barcode-scanner-api-samples/scan-single-barcode/react/README.md rename to frameworks/react/scan-using-rtu-api/README.md index 10f597f1..78d419a2 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/react/README.md +++ b/frameworks/react/scan-using-rtu-api/README.md @@ -26,7 +26,7 @@ Then open http://localhost:3000/ to view the sample app. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/index.html b/frameworks/react/scan-using-rtu-api/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/index.html rename to frameworks/react/scan-using-rtu-api/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/package.json b/frameworks/react/scan-using-rtu-api/package.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/package.json rename to frameworks/react/scan-using-rtu-api/package.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/src/App.tsx b/frameworks/react/scan-using-rtu-api/src/App.tsx similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/src/App.tsx rename to frameworks/react/scan-using-rtu-api/src/App.tsx diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/src/main.tsx b/frameworks/react/scan-using-rtu-api/src/main.tsx similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/src/main.tsx rename to frameworks/react/scan-using-rtu-api/src/main.tsx diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.app.json b/frameworks/react/scan-using-rtu-api/tsconfig.app.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.app.json rename to frameworks/react/scan-using-rtu-api/tsconfig.app.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.json b/frameworks/react/scan-using-rtu-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.json rename to frameworks/react/scan-using-rtu-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.node.json b/frameworks/react/scan-using-rtu-api/tsconfig.node.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/tsconfig.node.json rename to frameworks/react/scan-using-rtu-api/tsconfig.node.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/react/vite.config.ts b/frameworks/react/scan-using-rtu-api/vite.config.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/react/vite.config.ts rename to frameworks/react/scan-using-rtu-api/vite.config.ts diff --git a/frameworks/requirejs/README.md b/frameworks/requirejs/README.md new file mode 100644 index 00000000..61a18db4 --- /dev/null +++ b/frameworks/requirejs/README.md @@ -0,0 +1,18 @@ +# RequireJS samples + +This directory contains RequireJS examples demonstrating how to use the Dynamsoft Barcode Reader with AMD/RequireJS loading. + +**Included examples** + +- scan-using-foundational-api/ — RequireJS demo page. +- scan-using-rtu-api/ — RTU API demo page. + +## Quick start + +1. Serve the pages with a local static server and open the HTML page in your browser. +2. e.g. python -m http.server or npx http-server + +## Notes + +- RequireJS pages must be served via HTTP; opening files directly may fail. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/requirejs.html b/frameworks/requirejs/scan-using-foundational-api/requirejs.html similarity index 100% rename from foundational-api-samples/hello-world/requirejs.html rename to frameworks/requirejs/scan-using-foundational-api/requirejs.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/requirejs.html b/frameworks/requirejs/scan-using-rtu-api/requirejs.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/requirejs.html rename to frameworks/requirejs/scan-using-rtu-api/requirejs.html diff --git a/frameworks/svelte/README.md b/frameworks/svelte/README.md new file mode 100644 index 00000000..3cea8a4e --- /dev/null +++ b/frameworks/svelte/README.md @@ -0,0 +1,23 @@ +# Svelte samples + +This directory contains Svelte examples demonstrating how to use the Dynamsoft Barcode Reader in Svelte applications. + +**Included examples** + +- scan-using-foundational-api/ — Svelte + Vite example using foundational API. +- scan-using-rtu-api/ — RTU API Svelte example. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for exact steps (typically: npm install && npm run dev). + +## Notes + +- Run via Vite or the framework dev server; opening files directly may break functionality. +- See the repository root README.md for general usage and license information. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/svelte/.gitignore b/frameworks/svelte/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/svelte/.gitignore rename to frameworks/svelte/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/svelte/README.md b/frameworks/svelte/scan-using-foundational-api/README.md similarity index 98% rename from foundational-api-samples/hello-world/svelte/README.md rename to frameworks/svelte/scan-using-foundational-api/README.md index 3ba87c95..512d0e39 100644 --- a/foundational-api-samples/hello-world/svelte/README.md +++ b/frameworks/svelte/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000](htt ## Official Sample -* Hello World for Vite + Svelte + TS - Source Code +* Hello World for Vite + Svelte + TS - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/svelte/index.html b/frameworks/svelte/scan-using-foundational-api/index.html similarity index 100% rename from foundational-api-samples/hello-world/svelte/index.html rename to frameworks/svelte/scan-using-foundational-api/index.html diff --git a/foundational-api-samples/hello-world/svelte/logo.svg b/frameworks/svelte/scan-using-foundational-api/logo.svg similarity index 100% rename from foundational-api-samples/hello-world/svelte/logo.svg rename to frameworks/svelte/scan-using-foundational-api/logo.svg diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/package.json b/frameworks/svelte/scan-using-foundational-api/package.json similarity index 89% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/package.json rename to frameworks/svelte/scan-using-foundational-api/package.json index 7100687f..2923e632 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/svelte/package.json +++ b/frameworks/svelte/scan-using-foundational-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-svelte-sample", + "name": "dbrjs-svelte-foundational", "private": true, "version": "0.0.0", "type": "module", @@ -19,6 +19,6 @@ "svelte-check": "^3.6.6", "tslib": "^2.6.2", "typescript": "^5.2.2", - "vite": "^5.1.6" + "vite": "^6.0.5" } } diff --git a/foundational-api-samples/hello-world/svelte/src/App.svelte b/frameworks/svelte/scan-using-foundational-api/src/App.svelte similarity index 100% rename from foundational-api-samples/hello-world/svelte/src/App.svelte rename to frameworks/svelte/scan-using-foundational-api/src/App.svelte diff --git a/foundational-api-samples/hello-world/svelte/src/components/ImageCapture.svelte b/frameworks/svelte/scan-using-foundational-api/src/components/ImageCapture.svelte similarity index 100% rename from foundational-api-samples/hello-world/svelte/src/components/ImageCapture.svelte rename to frameworks/svelte/scan-using-foundational-api/src/components/ImageCapture.svelte diff --git a/foundational-api-samples/hello-world/svelte/src/components/VideoCapture.svelte b/frameworks/svelte/scan-using-foundational-api/src/components/VideoCapture.svelte similarity index 100% rename from foundational-api-samples/hello-world/svelte/src/components/VideoCapture.svelte rename to frameworks/svelte/scan-using-foundational-api/src/components/VideoCapture.svelte diff --git a/foundational-api-samples/hello-world/svelte/src/dynamsoft.config.ts b/frameworks/svelte/scan-using-foundational-api/src/dynamsoft.config.ts similarity index 97% rename from foundational-api-samples/hello-world/svelte/src/dynamsoft.config.ts rename to frameworks/svelte/scan-using-foundational-api/src/dynamsoft.config.ts index 475abef1..f3474c37 100644 --- a/foundational-api-samples/hello-world/svelte/src/dynamsoft.config.ts +++ b/frameworks/svelte/scan-using-foundational-api/src/dynamsoft.config.ts @@ -8,9 +8,7 @@ CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); +LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/src/main.ts b/frameworks/svelte/scan-using-foundational-api/src/main.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/src/main.ts rename to frameworks/svelte/scan-using-foundational-api/src/main.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/src/vite-env.d.ts b/frameworks/svelte/scan-using-foundational-api/src/vite-env.d.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/src/vite-env.d.ts rename to frameworks/svelte/scan-using-foundational-api/src/vite-env.d.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/svelte.config.js b/frameworks/svelte/scan-using-foundational-api/svelte.config.js similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/svelte.config.js rename to frameworks/svelte/scan-using-foundational-api/svelte.config.js diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/tsconfig.json b/frameworks/svelte/scan-using-foundational-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/tsconfig.json rename to frameworks/svelte/scan-using-foundational-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/tsconfig.node.json b/frameworks/svelte/scan-using-foundational-api/tsconfig.node.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/tsconfig.node.json rename to frameworks/svelte/scan-using-foundational-api/tsconfig.node.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/vite.config.ts b/frameworks/svelte/scan-using-foundational-api/vite.config.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/vite.config.ts rename to frameworks/svelte/scan-using-foundational-api/vite.config.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/.gitignore b/frameworks/svelte/scan-using-rtu-api/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/.gitignore rename to frameworks/svelte/scan-using-rtu-api/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/README.md b/frameworks/svelte/scan-using-rtu-api/README.md similarity index 70% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/README.md rename to frameworks/svelte/scan-using-rtu-api/README.md index ccb3dcaf..c986a501 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/svelte/README.md +++ b/frameworks/svelte/scan-using-rtu-api/README.md @@ -26,7 +26,7 @@ Then open http://localhost:5173/ to view the sample app. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/index.html b/frameworks/svelte/scan-using-rtu-api/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/index.html rename to frameworks/svelte/scan-using-rtu-api/index.html diff --git a/foundational-api-samples/hello-world/svelte/package.json b/frameworks/svelte/scan-using-rtu-api/package.json similarity index 90% rename from foundational-api-samples/hello-world/svelte/package.json rename to frameworks/svelte/scan-using-rtu-api/package.json index 7100687f..55d62db7 100644 --- a/foundational-api-samples/hello-world/svelte/package.json +++ b/frameworks/svelte/scan-using-rtu-api/package.json @@ -1,5 +1,5 @@ { - "name": "dbrjs-svelte-sample", + "name": "dbrjs-svelte-rtu", "private": true, "version": "0.0.0", "type": "module", @@ -19,6 +19,6 @@ "svelte-check": "^3.6.6", "tslib": "^2.6.2", "typescript": "^5.2.2", - "vite": "^5.1.6" + "vite": "^6.0.5" } } diff --git a/barcode-scanner-api-samples/scan-single-barcode/svelte/src/App.svelte b/frameworks/svelte/scan-using-rtu-api/src/App.svelte similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/svelte/src/App.svelte rename to frameworks/svelte/scan-using-rtu-api/src/App.svelte diff --git a/foundational-api-samples/hello-world/svelte/src/main.ts b/frameworks/svelte/scan-using-rtu-api/src/main.ts similarity index 100% rename from foundational-api-samples/hello-world/svelte/src/main.ts rename to frameworks/svelte/scan-using-rtu-api/src/main.ts diff --git a/foundational-api-samples/hello-world/svelte/src/vite-env.d.ts b/frameworks/svelte/scan-using-rtu-api/src/vite-env.d.ts similarity index 100% rename from foundational-api-samples/hello-world/svelte/src/vite-env.d.ts rename to frameworks/svelte/scan-using-rtu-api/src/vite-env.d.ts diff --git a/foundational-api-samples/hello-world/svelte/svelte.config.js b/frameworks/svelte/scan-using-rtu-api/svelte.config.js similarity index 100% rename from foundational-api-samples/hello-world/svelte/svelte.config.js rename to frameworks/svelte/scan-using-rtu-api/svelte.config.js diff --git a/foundational-api-samples/hello-world/svelte/tsconfig.json b/frameworks/svelte/scan-using-rtu-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/svelte/tsconfig.json rename to frameworks/svelte/scan-using-rtu-api/tsconfig.json diff --git a/foundational-api-samples/hello-world/svelte/tsconfig.node.json b/frameworks/svelte/scan-using-rtu-api/tsconfig.node.json similarity index 100% rename from foundational-api-samples/hello-world/svelte/tsconfig.node.json rename to frameworks/svelte/scan-using-rtu-api/tsconfig.node.json diff --git a/foundational-api-samples/hello-world/svelte/vite.config.ts b/frameworks/svelte/scan-using-rtu-api/vite.config.ts similarity index 100% rename from foundational-api-samples/hello-world/svelte/vite.config.ts rename to frameworks/svelte/scan-using-rtu-api/vite.config.ts diff --git a/frameworks/vue/README.md b/frameworks/vue/README.md new file mode 100644 index 00000000..05808ade --- /dev/null +++ b/frameworks/vue/README.md @@ -0,0 +1,30 @@ +# Vue samples + +This directory contains Vue-based examples demonstrating how to use the Dynamsoft Barcode Reader (JavaScript edition) in Vue projects. + +**Included examples** + +- `scan-using-foundational-api/` — Full example using the foundational API. +- `scan-using-rtu-api/` — Demo showing usage of the RTU API. + +## Quick start + +1. Change to a subexample directory, for example: + + ```bash + cd scan-using-foundational-api + ``` + +2. Install dependencies and start the dev server: + + ```bash + npm install + npm run dev + ``` + +3. Open the local address shown in the terminal (commonly `http://localhost:3000` when using Vite). + +## Notes + +- Run the example via a development server. Opening static HTML files directly may break module loading or camera access. +- For general usage and license info, see the repository root `README.md`. \ No newline at end of file diff --git a/foundational-api-samples/hello-world/vue/.gitignore b/frameworks/vue/scan-using-foundational-api/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/vue/.gitignore rename to frameworks/vue/scan-using-foundational-api/.gitignore diff --git a/foundational-api-samples/hello-world/vue/README.md b/frameworks/vue/scan-using-foundational-api/README.md similarity index 99% rename from foundational-api-samples/hello-world/vue/README.md rename to frameworks/vue/scan-using-foundational-api/README.md index 956a5aeb..367862ba 100644 --- a/foundational-api-samples/hello-world/vue/README.md +++ b/frameworks/vue/scan-using-foundational-api/README.md @@ -12,7 +12,7 @@ In this guide, we will be using [`dynamsoft-barcode-reader-bundle 11.2.4000](htt ## Official Sample -* Hello World in Vue 3 - Source Code +* Hello World in Vue 3 - Source Code ## Preparation diff --git a/foundational-api-samples/hello-world/vue/env.d.ts b/frameworks/vue/scan-using-foundational-api/env.d.ts similarity index 100% rename from foundational-api-samples/hello-world/vue/env.d.ts rename to frameworks/vue/scan-using-foundational-api/env.d.ts diff --git a/foundational-api-samples/hello-world/vue/index.html b/frameworks/vue/scan-using-foundational-api/index.html similarity index 100% rename from foundational-api-samples/hello-world/vue/index.html rename to frameworks/vue/scan-using-foundational-api/index.html diff --git a/foundational-api-samples/hello-world/vue/package.json b/frameworks/vue/scan-using-foundational-api/package.json similarity index 100% rename from foundational-api-samples/hello-world/vue/package.json rename to frameworks/vue/scan-using-foundational-api/package.json diff --git a/foundational-api-samples/hello-world/vue/public/favicon.ico b/frameworks/vue/scan-using-foundational-api/public/favicon.ico similarity index 100% rename from foundational-api-samples/hello-world/vue/public/favicon.ico rename to frameworks/vue/scan-using-foundational-api/public/favicon.ico diff --git a/foundational-api-samples/hello-world/vue/src/App.vue b/frameworks/vue/scan-using-foundational-api/src/App.vue similarity index 100% rename from foundational-api-samples/hello-world/vue/src/App.vue rename to frameworks/vue/scan-using-foundational-api/src/App.vue diff --git a/foundational-api-samples/hello-world/vue/src/assets/logo.svg b/frameworks/vue/scan-using-foundational-api/src/assets/logo.svg similarity index 100% rename from foundational-api-samples/hello-world/vue/src/assets/logo.svg rename to frameworks/vue/scan-using-foundational-api/src/assets/logo.svg diff --git a/foundational-api-samples/hello-world/vue/src/assets/main.css b/frameworks/vue/scan-using-foundational-api/src/assets/main.css similarity index 100% rename from foundational-api-samples/hello-world/vue/src/assets/main.css rename to frameworks/vue/scan-using-foundational-api/src/assets/main.css diff --git a/foundational-api-samples/hello-world/vue/src/components/ImageCapture.vue b/frameworks/vue/scan-using-foundational-api/src/components/ImageCapture.vue similarity index 100% rename from foundational-api-samples/hello-world/vue/src/components/ImageCapture.vue rename to frameworks/vue/scan-using-foundational-api/src/components/ImageCapture.vue diff --git a/foundational-api-samples/hello-world/vue/src/components/VideoCapture.vue b/frameworks/vue/scan-using-foundational-api/src/components/VideoCapture.vue similarity index 100% rename from foundational-api-samples/hello-world/vue/src/components/VideoCapture.vue rename to frameworks/vue/scan-using-foundational-api/src/components/VideoCapture.vue diff --git a/foundational-api-samples/hello-world/vue/src/dynamsoft.config.ts b/frameworks/vue/scan-using-foundational-api/src/dynamsoft.config.ts similarity index 97% rename from foundational-api-samples/hello-world/vue/src/dynamsoft.config.ts rename to frameworks/vue/scan-using-foundational-api/src/dynamsoft.config.ts index 744bd1ed..185ff12a 100644 --- a/foundational-api-samples/hello-world/vue/src/dynamsoft.config.ts +++ b/frameworks/vue/scan-using-foundational-api/src/dynamsoft.config.ts @@ -7,9 +7,7 @@ CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/"; * To use the library, you need to first specify a license key using the API "initLicense()" as shown below. */ -LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", { - executeNow: true, -}); +LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); /** * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days. diff --git a/foundational-api-samples/hello-world/vue/src/main.ts b/frameworks/vue/scan-using-foundational-api/src/main.ts similarity index 100% rename from foundational-api-samples/hello-world/vue/src/main.ts rename to frameworks/vue/scan-using-foundational-api/src/main.ts diff --git a/foundational-api-samples/hello-world/vue/tsconfig.config.json b/frameworks/vue/scan-using-foundational-api/tsconfig.config.json similarity index 100% rename from foundational-api-samples/hello-world/vue/tsconfig.config.json rename to frameworks/vue/scan-using-foundational-api/tsconfig.config.json diff --git a/foundational-api-samples/hello-world/vue/tsconfig.json b/frameworks/vue/scan-using-foundational-api/tsconfig.json similarity index 100% rename from foundational-api-samples/hello-world/vue/tsconfig.json rename to frameworks/vue/scan-using-foundational-api/tsconfig.json diff --git a/foundational-api-samples/hello-world/vue/vite.config.ts b/frameworks/vue/scan-using-foundational-api/vite.config.ts similarity index 100% rename from foundational-api-samples/hello-world/vue/vite.config.ts rename to frameworks/vue/scan-using-foundational-api/vite.config.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/.gitignore b/frameworks/vue/scan-using-rtu-api/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/.gitignore rename to frameworks/vue/scan-using-rtu-api/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/README.md b/frameworks/vue/scan-using-rtu-api/README.md similarity index 70% rename from barcode-scanner-api-samples/scan-single-barcode/vue/README.md rename to frameworks/vue/scan-using-rtu-api/README.md index dd641687..8dead72e 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/vue/README.md +++ b/frameworks/vue/scan-using-rtu-api/README.md @@ -26,7 +26,7 @@ Then open http://localhost:5173/ to view the sample app. ## 📌 Customization -Please refer to sample [`scan-multiple-barcodes`](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-multiple-barcodes) or check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). +Please check the official [documentation](https://dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html). ## 📄 Support diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/index.html b/frameworks/vue/scan-using-rtu-api/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/index.html rename to frameworks/vue/scan-using-rtu-api/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/package.json b/frameworks/vue/scan-using-rtu-api/package.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/package.json rename to frameworks/vue/scan-using-rtu-api/package.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/src/App.vue b/frameworks/vue/scan-using-rtu-api/src/App.vue similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/src/App.vue rename to frameworks/vue/scan-using-rtu-api/src/App.vue diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/src/main.ts b/frameworks/vue/scan-using-rtu-api/src/main.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/src/main.ts rename to frameworks/vue/scan-using-rtu-api/src/main.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/src/vite-env.d.ts b/frameworks/vue/scan-using-rtu-api/src/vite-env.d.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/src/vite-env.d.ts rename to frameworks/vue/scan-using-rtu-api/src/vite-env.d.ts diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.app.json b/frameworks/vue/scan-using-rtu-api/tsconfig.app.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.app.json rename to frameworks/vue/scan-using-rtu-api/tsconfig.app.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.json b/frameworks/vue/scan-using-rtu-api/tsconfig.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.json rename to frameworks/vue/scan-using-rtu-api/tsconfig.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.node.json b/frameworks/vue/scan-using-rtu-api/tsconfig.node.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/tsconfig.node.json rename to frameworks/vue/scan-using-rtu-api/tsconfig.node.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/vue/vite.config.ts b/frameworks/vue/scan-using-rtu-api/vite.config.ts similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/vue/vite.config.ts rename to frameworks/vue/scan-using-rtu-api/vite.config.ts diff --git a/frameworks/webview/README.md b/frameworks/webview/README.md new file mode 100644 index 00000000..5a761c48 --- /dev/null +++ b/frameworks/webview/README.md @@ -0,0 +1,23 @@ +# WebView samples + +This directory contains WebView examples demonstrating how to use the Dynamsoft Barcode Reader inside native WebView-based apps (Android/iOS). + +**Included examples** + +- scan-using-foundational-api/ — WebView project with native wrappers and HTML demo. +- scan-using-rtu-api/ — WebView RTU example. + +## Quick start + +1. Change to a subexample directory, e.g.: + + ```bash + cd scan-using-foundational-api + ``` + +2. Follow the subexample README for platform-specific setup (open Android Studio/Xcode or run provided scripts). + +## Notes + +- Native build environments are required for mobile platform testing. See subexample README for details. +- See the repository root README.md for general usage and license \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/.gitignore b/frameworks/webview/scan-using-foundational-api/android/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/.gitignore rename to frameworks/webview/scan-using-foundational-api/android/.gitignore diff --git a/foundational-api-samples/hello-world/webview/android/README.md b/frameworks/webview/scan-using-foundational-api/android/README.md similarity index 100% rename from foundational-api-samples/hello-world/webview/android/README.md rename to frameworks/webview/scan-using-foundational-api/android/README.md diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/.gitignore b/frameworks/webview/scan-using-foundational-api/android/app/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/.gitignore rename to frameworks/webview/scan-using-foundational-api/android/app/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/build.gradle b/frameworks/webview/scan-using-foundational-api/android/app/build.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/build.gradle rename to frameworks/webview/scan-using-foundational-api/android/app/build.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/proguard-rules.pro b/frameworks/webview/scan-using-foundational-api/android/app/proguard-rules.pro similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/proguard-rules.pro rename to frameworks/webview/scan-using-foundational-api/android/app/proguard-rules.pro diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/AndroidManifest.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/AndroidManifest.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/AndroidManifest.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/AndroidManifest.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/assets/decodeBarcodeInVideo.html b/frameworks/webview/scan-using-foundational-api/android/app/src/main/assets/decodeBarcodeInVideo.html similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/assets/decodeBarcodeInVideo.html rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/assets/decodeBarcodeInVideo.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt b/frameworks/webview/scan-using-foundational-api/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/drawable/ic_launcher_background.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/drawable/ic_launcher_background.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/layout/activity_main.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/layout/activity_main.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/layout/activity_main.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/layout/activity_main.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values-night/themes.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values-night/themes.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values-night/themes.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values-night/themes.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/colors.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/colors.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/colors.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/colors.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/strings.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/strings.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/strings.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/strings.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/themes.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/themes.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/values/themes.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/values/themes.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/xml/backup_rules.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/xml/backup_rules.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/xml/backup_rules.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/xml/backup_rules.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/xml/data_extraction_rules.xml b/frameworks/webview/scan-using-foundational-api/android/app/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/res/xml/data_extraction_rules.xml rename to frameworks/webview/scan-using-foundational-api/android/app/src/main/res/xml/data_extraction_rules.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/build.gradle b/frameworks/webview/scan-using-foundational-api/android/build.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/build.gradle rename to frameworks/webview/scan-using-foundational-api/android/build.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle.properties b/frameworks/webview/scan-using-foundational-api/android/gradle.properties similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle.properties rename to frameworks/webview/scan-using-foundational-api/android/gradle.properties diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle/wrapper/gradle-wrapper.jar b/frameworks/webview/scan-using-foundational-api/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle/wrapper/gradle-wrapper.jar rename to frameworks/webview/scan-using-foundational-api/android/gradle/wrapper/gradle-wrapper.jar diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle/wrapper/gradle-wrapper.properties b/frameworks/webview/scan-using-foundational-api/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/gradle/wrapper/gradle-wrapper.properties rename to frameworks/webview/scan-using-foundational-api/android/gradle/wrapper/gradle-wrapper.properties diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/gradlew b/frameworks/webview/scan-using-foundational-api/android/gradlew similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/gradlew rename to frameworks/webview/scan-using-foundational-api/android/gradlew diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/gradlew.bat b/frameworks/webview/scan-using-foundational-api/android/gradlew.bat similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/gradlew.bat rename to frameworks/webview/scan-using-foundational-api/android/gradlew.bat diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/settings.gradle b/frameworks/webview/scan-using-foundational-api/android/settings.gradle similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/settings.gradle rename to frameworks/webview/scan-using-foundational-api/android/settings.gradle diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/.gitignore b/frameworks/webview/scan-using-foundational-api/ios/.gitignore similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/.gitignore rename to frameworks/webview/scan-using-foundational-api/ios/.gitignore diff --git a/foundational-api-samples/hello-world/webview/ios/README.md b/frameworks/webview/scan-using-foundational-api/ios/README.md similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/README.md rename to frameworks/webview/scan-using-foundational-api/ios/README.md diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.pbxproj b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.pbxproj similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.pbxproj rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.pbxproj diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/AppDelegate.swift b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/AppDelegate.swift similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/AppDelegate.swift rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/AppDelegate.swift diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/Contents.json b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/Contents.json similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Assets.xcassets/Contents.json rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Assets.xcassets/Contents.json diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Base.lproj/Main.storyboard b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Base.lproj/Main.storyboard similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Base.lproj/Main.storyboard rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Base.lproj/Main.storyboard diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Info.plist b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Info.plist similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/Info.plist rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/Info.plist diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/SceneDelegate.swift b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/SceneDelegate.swift similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/SceneDelegate.swift rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/SceneDelegate.swift diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/ViewController.swift b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/ViewController.swift similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/ViewController.swift rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/ViewController.swift diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/html/decodeFileInVideo.html b/frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/html/decodeFileInVideo.html similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/html/decodeFileInVideo.html rename to frameworks/webview/scan-using-foundational-api/ios/dbrjswebview/html/decodeFileInVideo.html diff --git a/foundational-api-samples/hello-world/webview/android/.gitignore b/frameworks/webview/scan-using-rtu-api/android/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/webview/android/.gitignore rename to frameworks/webview/scan-using-rtu-api/android/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/README.md b/frameworks/webview/scan-using-rtu-api/android/README.md similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/README.md rename to frameworks/webview/scan-using-rtu-api/android/README.md diff --git a/foundational-api-samples/hello-world/webview/android/app/.gitignore b/frameworks/webview/scan-using-rtu-api/android/app/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/.gitignore rename to frameworks/webview/scan-using-rtu-api/android/app/.gitignore diff --git a/foundational-api-samples/hello-world/webview/android/app/build.gradle b/frameworks/webview/scan-using-rtu-api/android/app/build.gradle similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/build.gradle rename to frameworks/webview/scan-using-rtu-api/android/app/build.gradle diff --git a/foundational-api-samples/hello-world/webview/android/app/proguard-rules.pro b/frameworks/webview/scan-using-rtu-api/android/app/proguard-rules.pro similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/proguard-rules.pro rename to frameworks/webview/scan-using-rtu-api/android/app/proguard-rules.pro diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/AndroidManifest.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/AndroidManifest.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/AndroidManifest.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/AndroidManifest.xml diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/assets/decodeBarcodeInVideo.html b/frameworks/webview/scan-using-rtu-api/android/app/src/main/assets/decodeBarcodeInVideo.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/android/app/src/main/assets/decodeBarcodeInVideo.html rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/assets/decodeBarcodeInVideo.html diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt b/frameworks/webview/scan-using-rtu-api/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/java/com/dynamsoft/dbrjswebview/MainActivity.kt diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/drawable/ic_launcher_background.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/drawable/ic_launcher_background.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/layout/activity_main.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/layout/activity_main.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/layout/activity_main.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/layout/activity_main.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/values-night/themes.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values-night/themes.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/values-night/themes.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values-night/themes.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/values/colors.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/colors.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/values/colors.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/colors.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/values/strings.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/strings.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/values/strings.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/strings.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/values/themes.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/themes.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/values/themes.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/values/themes.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/xml/backup_rules.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/xml/backup_rules.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/xml/backup_rules.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/xml/backup_rules.xml diff --git a/foundational-api-samples/hello-world/webview/android/app/src/main/res/xml/data_extraction_rules.xml b/frameworks/webview/scan-using-rtu-api/android/app/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from foundational-api-samples/hello-world/webview/android/app/src/main/res/xml/data_extraction_rules.xml rename to frameworks/webview/scan-using-rtu-api/android/app/src/main/res/xml/data_extraction_rules.xml diff --git a/foundational-api-samples/hello-world/webview/android/build.gradle b/frameworks/webview/scan-using-rtu-api/android/build.gradle similarity index 100% rename from foundational-api-samples/hello-world/webview/android/build.gradle rename to frameworks/webview/scan-using-rtu-api/android/build.gradle diff --git a/foundational-api-samples/hello-world/webview/android/gradle.properties b/frameworks/webview/scan-using-rtu-api/android/gradle.properties similarity index 100% rename from foundational-api-samples/hello-world/webview/android/gradle.properties rename to frameworks/webview/scan-using-rtu-api/android/gradle.properties diff --git a/foundational-api-samples/hello-world/webview/android/gradle/wrapper/gradle-wrapper.jar b/frameworks/webview/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from foundational-api-samples/hello-world/webview/android/gradle/wrapper/gradle-wrapper.jar rename to frameworks/webview/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.jar diff --git a/foundational-api-samples/hello-world/webview/android/gradle/wrapper/gradle-wrapper.properties b/frameworks/webview/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from foundational-api-samples/hello-world/webview/android/gradle/wrapper/gradle-wrapper.properties rename to frameworks/webview/scan-using-rtu-api/android/gradle/wrapper/gradle-wrapper.properties diff --git a/foundational-api-samples/hello-world/webview/android/gradlew b/frameworks/webview/scan-using-rtu-api/android/gradlew similarity index 100% rename from foundational-api-samples/hello-world/webview/android/gradlew rename to frameworks/webview/scan-using-rtu-api/android/gradlew diff --git a/foundational-api-samples/hello-world/webview/android/gradlew.bat b/frameworks/webview/scan-using-rtu-api/android/gradlew.bat similarity index 100% rename from foundational-api-samples/hello-world/webview/android/gradlew.bat rename to frameworks/webview/scan-using-rtu-api/android/gradlew.bat diff --git a/foundational-api-samples/hello-world/webview/android/settings.gradle b/frameworks/webview/scan-using-rtu-api/android/settings.gradle similarity index 100% rename from foundational-api-samples/hello-world/webview/android/settings.gradle rename to frameworks/webview/scan-using-rtu-api/android/settings.gradle diff --git a/foundational-api-samples/hello-world/webview/ios/.gitignore b/frameworks/webview/scan-using-rtu-api/ios/.gitignore similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/.gitignore rename to frameworks/webview/scan-using-rtu-api/ios/.gitignore diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/README.md b/frameworks/webview/scan-using-rtu-api/ios/README.md similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/README.md rename to frameworks/webview/scan-using-rtu-api/ios/README.md diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.pbxproj b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.pbxproj similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.pbxproj rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.pbxproj diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/AppDelegate.swift b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/AppDelegate.swift similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/AppDelegate.swift rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/AppDelegate.swift diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/Contents.json b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/Contents.json similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Assets.xcassets/Contents.json rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Assets.xcassets/Contents.json diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Base.lproj/LaunchScreen.storyboard diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Base.lproj/Main.storyboard b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Base.lproj/Main.storyboard similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Base.lproj/Main.storyboard rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Base.lproj/Main.storyboard diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/Info.plist b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Info.plist similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/Info.plist rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/Info.plist diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/SceneDelegate.swift b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/SceneDelegate.swift similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/SceneDelegate.swift rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/SceneDelegate.swift diff --git a/foundational-api-samples/hello-world/webview/ios/dbrjswebview/ViewController.swift b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/ViewController.swift similarity index 100% rename from foundational-api-samples/hello-world/webview/ios/dbrjswebview/ViewController.swift rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/ViewController.swift diff --git a/barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/html/decodeFileInVideo.html b/frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/html/decodeFileInVideo.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/webview/ios/dbrjswebview/html/decodeFileInVideo.html rename to frameworks/webview/scan-using-rtu-api/ios/dbrjswebview/html/decodeFileInVideo.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/hello-world.html b/hello-world.html similarity index 98% rename from barcode-scanner-api-samples/scan-single-barcode/hello-world.html rename to hello-world.html index a7b6b8f2..21c3103f 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/hello-world.html +++ b/hello-world.html @@ -26,7 +26,6 @@

let config = { license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", // Replace with your Dynamsoft license key container: document.querySelector(".barcode-scanner-view"), // Specify where to render the scanner UI - // showUploadImageButton: true, // scannerViewConfig: { // showFlashButton: true, @@ -42,7 +41,10 @@

// Display the first detected barcode's text in an alert if (result.barcodeResults.length) { alert(result.barcodeResults[0].text); + } else{ + alert("No barcode found"); } + }); diff --git a/index.html b/index.html index 3e9b6ec8..657a511c 100644 --- a/index.html +++ b/index.html @@ -1,419 +1,1561 @@ - - - - + + + + - + Dynamsoft Barcode Reader Samples - + - - + +
- - + + + + + + + + +
+ + 🔍 +
+ + + + + +
+

+ Framework Samples (14) + README +

+
+
-

BarcodeScanner API Samples

+ Angular Samples - + Source
-
-
Scan Single Barcode
- -
Scan Multiple Barcodes
- +
+ Blazor Samples - + Source +
+
+ Capacitor Samples - + Source +
+
+ Electron Samples - + Source +
+
+ ES6 Samples - + Source +
+
+ Native TypeScript Samples - + Source +
+
+ Next.js Samples - + Source +
+
+ Nuxt Samples - + Source
-

Foundational API Samples

+ PWA Samples - + Source
+
+ React Samples - + Source +
+
+ RequireJS Samples - + Source +
+
+ Svelte Samples - + Source +
+
+ Vue Samples - + Source +
+
+ WebView Samples - + Source +
+
+ + +
+

+ Scenario Samples (17) + README +

+
+ - + + diff --git a/foundational-api-samples/hello-world/read-an-image.html b/read-an-image.html similarity index 98% rename from foundational-api-samples/hello-world/read-an-image.html rename to read-an-image.html index a0f678a6..dbd49cbc 100644 --- a/foundational-api-samples/hello-world/read-an-image.html +++ b/read-an-image.html @@ -4,7 +4,7 @@ - + Dynamsoft Barcode Reader Sample - Hello World (Read an Image) @@ -74,4 +74,4 @@

Hello World (Read an Image)

- \ No newline at end of file + diff --git a/scenarios/README.md b/scenarios/README.md new file mode 100644 index 00000000..ae1560a4 --- /dev/null +++ b/scenarios/README.md @@ -0,0 +1,30 @@ +# Scenarios samples + +This directory contains focused scenario samples that show common real-world uses of the Dynamsoft Barcode Reader (JavaScript edition). Each sample is a small, runnable example illustrating a specific workflow. + +Included samples + +- [pick-one-to-fill/](./pick-one-to-fill/) — Picking the correct one from multiple candidates by scanning barcodes. +- [cart-builder/](./cart-builder/) — Single-page demo illustrating adding scanned items into a shopping cart. +- [scan-and-search/](./scan-and-search/) — Example that scans a barcode and performs a lookup/search operation. +- [show-result-texts-on-the-video/](./show-result-texts-on-the-video/) — Overlay decoded text on live video while scanning. +- [batch-inventory/](./batch-inventory/) — Batch scanning workflow for inventory collection and export. +- [read-a-drivers-license/](./read-a-drivers-license/) — Demo for reading and parsing a driver's license image/data. +- [read-vin/](./read-vin/) — Demo for reading and parsing a VIN(vehicle identification number) code. +- [read-and-parse-GS1-AI/](./read-and-parse-GS1-AI/) — Example showing GS1 AI parsing and data extraction. +- [scan-qr-code/](./scan-qr-code/) — QR code targeted demo and settings. +- [scan-datamatrix-code/](./scan-datamatrix-code/) — DataMatrix code targeted demo and settings. +- [scan-common-1D-and-2D/](./scan-common-1D-and-2D/) — Demo configured to detect a wide range of barcode formats. +- [scan-common-2D-codes/](./scan-common-2D-codes/) — Focused on common 2D barcode formats decoding. +- [scan-1D-Retail/](./scan-1D-Retail/) — 1D retail barcode tuning example. +- [scan-1D-Industrial/](./scan-1D-Industrial/) — 1D industrial barcode tuning example. +- [scan-from-distance/](./scan-from-distance/) — Demo for scanning barcodes from a distance (zoom/ROI tuning). +- [locate-an-item-with-barcode/](./locate-an-item-with-barcode/) — UI to help locate items with barcodes in a list or layout. +- [debug/](./debug/) — Debug utilities and a small server (frame collector) used for testing and troubleshooting. + +>[!NOTE] +> +>- Use a development server; opening pages via file:// may break module loading or camera access. +>- Camera and microphone access require secure context (https or localhost). +>- A trial license is included for short-term testing; get a trial license from Dynamsoft for extended evaluation. +>- See the repo root README.md for general instructions and links to API. \ No newline at end of file diff --git a/scenarios/batch-inventory/README.md b/scenarios/batch-inventory/README.md new file mode 100644 index 00000000..9414c435 --- /dev/null +++ b/scenarios/batch-inventory/README.md @@ -0,0 +1,41 @@ +# 🧾 Batch Inventory + +A lightweight demo for batch scanning and simple inventory collection. The sample uses the Dynamsoft Barcode Reader bundle to capture barcodes in sessions, automatically deduplicate entries, and present a session summary for quick analysis or export. + +## Included files + +- `index.html` — main demo page (camera scanner UI + session controls). +- `index.css` — styles for the demo. + +## ✨ Features + +- Batch scanning mode with automatic per-session deduplication +- Real-time session summary: + - Total unique barcodes + - Barcode format/type distribution + - Session duration + +## 🔧 How it works + +- The page creates a BarcodeScanner instance configured for multi-unique capture (SM_MULTI_UNIQUE or equivalent) so duplicate barcodes within the same session are ignored. +- Scanned values are accumulated in-memory and analyzed to produce session metrics (counts, distribution, duration). +- Users can stop a session to view the summary, or restart scanning to begin a new session. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use a fixed camera mount or consistent hand positioning for higher throughput. +- For large exports, consider paginating or streaming results to a backend. + +## 📌 Notes + +- Run on localhost or HTTPS to allow camera access. +- This demo is intended for prototyping and UX testing; integrate with backend storage for production use. +- Replace the included demo/trial license with a valid Dynamsoft license for extended evaluation. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.css b/scenarios/batch-inventory/index.css similarity index 100% rename from barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.css rename to scenarios/batch-inventory/index.css diff --git a/barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.html b/scenarios/batch-inventory/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-multiple-barcodes/batch-inventory/index.html rename to scenarios/batch-inventory/index.html diff --git a/scenarios/cart-builder/README.md b/scenarios/cart-builder/README.md new file mode 100644 index 00000000..ebd5c5be --- /dev/null +++ b/scenarios/cart-builder/README.md @@ -0,0 +1,43 @@ +# 🛒 Cart Builder + +A lightweight demo that simulates a shopping experience: scan a barcode and add a product to a dynamic on‑page cart. The sample uses the Dynamsoft Barcode Reader bundle to perform live video decoding and demonstrates a simple UX for point‑of‑sale or prototype flows. + +## Included files + +- `cart-builder.html` — single‑file sample. + +## ✨ Features + +- Live camera decoding (1D / 2D) using Dynamsoft BarcodeScanner API +- Floating, draggable scanner window attached to the page +- Sessioned scans: each unique scan appends a product to the simulated cart +- Demo product list (20 dummy products) and simple cart UI with name and price + +## 🔧 How it works + +- The page loads the Dynamsoft Barcode Reader bundle and creates a BarcodeScanner instance configured with: + - SM_MULTI_UNIQUE scan mode (to prefer unique entries) + - a duplicateForgetTime to avoid rapid duplicate captures + - a scanner UI mounted into a floating container +- When a unique barcode is detected, the sample maps the scan to a random demo product, appends it to the in‑memory cart, and refreshes the cart display. +- The floating scanner can be dragged around the viewport and is hidden when not in use. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `cart-builder.html` and select "Open with Five Server". + +## 💡 Tips + +- Use localhost or HTTPS to allow camera access. +- Ensure good lighting and hold barcodes steady for best results. +- For real projects, replace the demo product mapping with a backend lookup using the scanned barcode value. + +## 📌 Notes + +- This is a front‑end prototype intended for demo and UX testing only. +- Replace the license key with a valid Dynamsoft license for production/testing beyond the included trial behavior. +- See the repository root `README.md` for running instructions, trial licenses and API documentation links. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html b/scenarios/cart-builder/cart-builder.html similarity index 100% rename from barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html rename to scenarios/cart-builder/cart-builder.html diff --git a/foundational-api-samples/others/debug/.gitignore b/scenarios/debug/.gitignore similarity index 100% rename from foundational-api-samples/others/debug/.gitignore rename to scenarios/debug/.gitignore diff --git a/foundational-api-samples/others/debug/README.md b/scenarios/debug/README.md similarity index 90% rename from foundational-api-samples/others/debug/README.md rename to scenarios/debug/README.md index 0bc80664..12b9f452 100644 --- a/foundational-api-samples/others/debug/README.md +++ b/scenarios/debug/README.md @@ -6,7 +6,7 @@ This sample is designed to: 2. Check if your device and browser are compatible with the camera and to what extent. 3. Collect video frames for analysis. (Require to host the sample locally) -You can directly debug 1 and 2 in this link: [https://demo.dynamsoft.com/Samples/DBR/JS/foundational-api-samples/others/debug/public/index.html](https://demo.dynamsoft.com/Samples/DBR/JS/foundational-api-samples/others/debug/public/index.html) +You can directly debug 1 and 2 in this link: [https://demo.dynamsoft.com/Samples/DBR/JS/scenarios/debug/public/index.html](https://demo.dynamsoft.com/Samples/DBR/JS/scenarios/debug/public/index.html) Item 3 we will introduce in detail. @@ -20,7 +20,7 @@ The following shows how to host the sample and collect frames. The sample can be downloaded from -Debug Sample on GitHub +Debug Sample on GitHub Note that the entire folder is required. To download only the files in this folder, try using "https://downgit.github.io/#/home". diff --git a/foundational-api-samples/others/debug/app.js b/scenarios/debug/app.js similarity index 100% rename from foundational-api-samples/others/debug/app.js rename to scenarios/debug/app.js diff --git a/foundational-api-samples/others/debug/package.json b/scenarios/debug/package.json similarity index 92% rename from foundational-api-samples/others/debug/package.json rename to scenarios/debug/package.json index 9eec8064..de1d03d1 100644 --- a/foundational-api-samples/others/debug/package.json +++ b/scenarios/debug/package.json @@ -11,6 +11,6 @@ "dependencies": { "cors": "^2.8.5", "express": "^4.17.1", - "multer": "^1.4.2" + "multer": "^2.0.2" } } diff --git a/foundational-api-samples/others/debug/pem/ryans-cert.pem b/scenarios/debug/pem/ryans-cert.pem similarity index 100% rename from foundational-api-samples/others/debug/pem/ryans-cert.pem rename to scenarios/debug/pem/ryans-cert.pem diff --git a/foundational-api-samples/others/debug/pem/ryans-csr.pem b/scenarios/debug/pem/ryans-csr.pem similarity index 100% rename from foundational-api-samples/others/debug/pem/ryans-csr.pem rename to scenarios/debug/pem/ryans-csr.pem diff --git a/foundational-api-samples/others/debug/pem/ryans-key.pem b/scenarios/debug/pem/ryans-key.pem similarity index 100% rename from foundational-api-samples/others/debug/pem/ryans-key.pem rename to scenarios/debug/pem/ryans-key.pem diff --git a/foundational-api-samples/others/debug/public/index.html b/scenarios/debug/public/index.html similarity index 99% rename from foundational-api-samples/others/debug/public/index.html rename to scenarios/debug/public/index.html index ca1cfef1..65b85960 100644 --- a/foundational-api-samples/others/debug/public/index.html +++ b/scenarios/debug/public/index.html @@ -78,6 +78,7 @@

Read Barcodes from Camera - Debug

let processingCount = 0; resultReceiver.onCapturedResultReceived = async (result) => { const resultItems = result.items; + if (!resultItems.length) return; if (resultItems.some((item) => item.type === "barcode")) { Dynamsoft.DCE.Feedback.beep(); diff --git a/scenarios/locate-an-item-with-barcode/README.md b/scenarios/locate-an-item-with-barcode/README.md new file mode 100644 index 00000000..90de1bf5 --- /dev/null +++ b/scenarios/locate-an-item-with-barcode/README.md @@ -0,0 +1,38 @@ +# 🔎 Locate an Item with Barcode + +A focused demo that helps locate and highlight items in a UI by scanning barcodes. Useful for inventory lookup, picking workflows, or warehouse/retail assistance where scanning a code should point you to the corresponding item on screen. + +## Included files + +- `index.html` — main demo page (camera + UI to locate items). +- `icons/` — UI icons used by the sample (checkmark, cross, logo). + +## ✨ Features + +- Scan a barcode (or fill in text) and find the matching item in the displayed list +- Visual highlight and status feedback for match / no-match cases +- Simple UI for quick prototyping of locate-by-barcode workflows + +## 🔧 How it works + +- The page runs a barcode scanner that decodes incoming frames. +- Decoded barcode values are compared against an on-page item dataset (client-side lookup). +- When a match is found the sample highlights the matched item and shows contextual feedback; when no match is found it displays an unmatched-result state. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Good lighting and steady camera framing improve decode accuracy. +- Use the icons folder as a reference for UI feedback and quick prototyping. + +## 📌 Notes + +- Serve via localhost or HTTPS to enable camera access. +- See the repository root `README.md` for running instructions, trial licenses and API documentation \ No newline at end of file diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/icons/checkmark-icon.svg b/scenarios/locate-an-item-with-barcode/icons/checkmark-icon.svg similarity index 100% rename from foundational-api-samples/use-case/locate-an-item-with-barcode/icons/checkmark-icon.svg rename to scenarios/locate-an-item-with-barcode/icons/checkmark-icon.svg diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/icons/cross-icon.svg b/scenarios/locate-an-item-with-barcode/icons/cross-icon.svg similarity index 100% rename from foundational-api-samples/use-case/locate-an-item-with-barcode/icons/cross-icon.svg rename to scenarios/locate-an-item-with-barcode/icons/cross-icon.svg diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/icons/dynamsoft-logo.png b/scenarios/locate-an-item-with-barcode/icons/dynamsoft-logo.png similarity index 100% rename from foundational-api-samples/use-case/locate-an-item-with-barcode/icons/dynamsoft-logo.png rename to scenarios/locate-an-item-with-barcode/icons/dynamsoft-logo.png diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/icons/scan-barcode-icon.svg b/scenarios/locate-an-item-with-barcode/icons/scan-barcode-icon.svg similarity index 100% rename from foundational-api-samples/use-case/locate-an-item-with-barcode/icons/scan-barcode-icon.svg rename to scenarios/locate-an-item-with-barcode/icons/scan-barcode-icon.svg diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html b/scenarios/locate-an-item-with-barcode/index.html similarity index 100% rename from foundational-api-samples/use-case/locate-an-item-with-barcode/index.html rename to scenarios/locate-an-item-with-barcode/index.html diff --git a/scenarios/pick-one-to-fill/README.md b/scenarios/pick-one-to-fill/README.md new file mode 100644 index 00000000..b280b595 --- /dev/null +++ b/scenarios/pick-one-to-fill/README.md @@ -0,0 +1,35 @@ +# ✅ Pick One to Fill + +A compact demo that helps pick the correct item from several candidates by scanning barcodes. The sample uses the Dynamsoft Barcode Reader bundle to decode barcodes from camera or image input and demonstrates a simple match-and-highlight UX. + +## Included files + +- `index.html` — main demo page. +- `index.css` — styles for the demo. +- `package-label.png` — sample product label used by the demo. + +## ✨ Features + +- Field-specific Camera Activation Open the camera individually for different fields. +- Manual control when to start decoding Start decoding manually after aiming at the target to reduce the risk of misreads and missed barcodes. +- Auto-Fill with Scan Result Automatically populates input fields with scanned barcode values. + +## 🔄 Sample Usage Flow + +1. Click the "Open Camera" button to activate the camera. +2. Aim at the sample image shown below. +3. Click the "Decode" button to start barcode recognition. +4. If only one barcode is detected, its value will be automatically filled into the corresponding field. If multiple barcodes are detected, the video stream will freeze, and you’ll need to manually select one from the decoded results to fill in. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 📌 Notes + +- This usage is especially suitable for scenarios with densely packed barcodes, where secondary confirmation or manual selection is highly needed. +- You can find a sample reference image in ·./pick-one-to-fill/· \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.css b/scenarios/pick-one-to-fill/index.css similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.css rename to scenarios/pick-one-to-fill/index.css diff --git a/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.html b/scenarios/pick-one-to-fill/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/index.html rename to scenarios/pick-one-to-fill/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/package-label.png b/scenarios/pick-one-to-fill/package-label.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/pick-one-to-fill/package-label.png rename to scenarios/pick-one-to-fill/package-label.png diff --git a/scenarios/read-a-drivers-license/README.md b/scenarios/read-a-drivers-license/README.md new file mode 100644 index 00000000..d571efa5 --- /dev/null +++ b/scenarios/read-a-drivers-license/README.md @@ -0,0 +1,39 @@ +# 🚗 Read a Driver's License + +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. + +## Included files + +- `index.html` — main demo page (camera + image input UI). +- `SampleDriversLicense.jpg` — example license image. +- `read_dl.json` — JSON template used by the sample. + +## ✨ Features + +- Decode driver's license barcode (PDF417 / AAMVA formats) from camera or static image +- Parse and display structured fields +- Simple UI for testing and validating parsing rules + +## 🔧 How it works + +- The page initializes the barcode scanner to decode the license barcode from an image or live video frame. +- The sample parsed fields are rendered in the UI alongside the raw decoded text; the sample also highlights parsing errors or missing fields for easier troubleshooting. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use high-resolution images or a higher camera resolution for reliable decoding and parsing. +- Test with multiple sample licenses to ensure the parsing template covers expected variants. + +## 📌 Notes + +- Serve via localhost or HTTPS to enable camera access. +- Replace the included trial/demo license with a valid Dynamsoft license for extended evaluation. +- See the repository root `README.md` for running instructions and API documentation. \ No newline at end of file diff --git a/scenarios/read-a-drivers-license/SampleDriversLicense.jpg b/scenarios/read-a-drivers-license/SampleDriversLicense.jpg new file mode 100644 index 00000000..d334f79d Binary files /dev/null and b/scenarios/read-a-drivers-license/SampleDriversLicense.jpg differ diff --git a/scenarios/read-a-drivers-license/index.html b/scenarios/read-a-drivers-license/index.html new file mode 100644 index 00000000..b75fa5f6 --- /dev/null +++ b/scenarios/read-a-drivers-license/index.html @@ -0,0 +1,170 @@ + + + + + + + + + + Dynamsoft Barcode Reader Sample - Read a Driver's License + + + + +
+

Read a Driver's License

+
+
+
+ +
+ logo-dynamsoft +
+
+
+
    +
    Back to Scan
    +
    + + + + + \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/logo-dynamsoft-blackBg-190x47-DZ66W3xz.png b/scenarios/read-a-drivers-license/logo-dynamsoft.png similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/logo-dynamsoft-blackBg-190x47-DZ66W3xz.png rename to scenarios/read-a-drivers-license/logo-dynamsoft.png diff --git a/scenarios/read-a-drivers-license/read_dl.json b/scenarios/read-a-drivers-license/read_dl.json new file mode 100644 index 00000000..883d3b60 --- /dev/null +++ b/scenarios/read-a-drivers-license/read_dl.json @@ -0,0 +1,124 @@ +{ + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "task_pdf417_barcode", + "MaxThreadsInOneTask":1, + "ExpectedBarcodesCount": 1, + "BarcodeFormatIds": [ + "BF_PDF417" + ], + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_SCAN_DIRECTLY" + } + ], + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" + }, + { + "Stage": "SST_LOCALIZE_BARCODES" + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "DeblurModes": [ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_DEEP_ANALYSIS", + "Methods": ["TwoDGeneral"] + } + ], + "Stage": "SST_DECODE_BARCODES" + } + ] + } + ] + } + ], + "CaptureVisionTemplates": [ + { + "Name": "ReadDriversLicense", + "ImageROIProcessingNameArray": [ + "roi_pdf417_barcode" + ] + } + ], + "ImageParameterOptions": [ + { + "Name": "ip", + "ApplicableStages": [ + { + "Stage": "SST_INPUT_COLOR_IMAGE" + }, + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "Stage": "SST_CONVERT_TO_GRAYSCALE" + }, + { + "Stage": "SST_TRANSFORM_GRAYSCALE" + }, + { + "Stage": "SST_ENHANCE_GRAYSCALE" + }, + { + "Stage": "SST_BINARIZE_IMAGE" + }, + { + "Stage": "SST_DETECT_TEXTURE" + }, + { + "Stage": "SST_REMOVE_TEXTURE_FROM_GRAYSCALE" + }, + { + "Stage": "SST_BINARIZE_TEXTURE_REMOVED_GRAYSCALE" + }, + { + "Stage": "SST_FIND_CONTOURS" + }, + { + "Stage": "SST_DETECT_SHORTLINES" + }, + { + "Stage": "SST_ASSEMBLE_LINES" + }, + { + "Stage": "SST_DETECT_TEXT_ZONES" + }, + { + "Stage": "SST_REMOVE_TEXT_ZONES_FROM_BINARY" + } + ] + } + ], + "TargetROIDefOptions": [ + { + "Name": "roi_pdf417_barcode", + "TaskSettingNameArray": [ + "task_pdf417_barcode" + ] + } + ] +} \ No newline at end of file diff --git a/scenarios/read-a-drivers-license/style.css b/scenarios/read-a-drivers-license/style.css new file mode 100644 index 00000000..61855c1e --- /dev/null +++ b/scenarios/read-a-drivers-license/style.css @@ -0,0 +1,154 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif; +} + +html, +body { + width: 100%; + height: 100% +} + +.home-page { + position: absolute; + width: 100%; + height: 100%; + background-color: #323234; + z-index: 2; +} + +.home-page .home-page-title { + width: 100%; + color: white; + position: absolute; + top: 35%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 30px; + text-align: center; +} + +.home-page .start-btn { + height: 10%; + min-height: 50px; + border-radius: 50%; + background-color: #ffffff; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + aspect-ratio: 1/1; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; +} + +.home-page .start-btn .start-icon { + width: 0; + height: 0; + border-top: 15px solid transparent; + border-bottom: 15px solid transparent; + border-left: 25px solid #FE8E14; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-40%, -50%); +} + +.home-page .start-btn .loading { + width: 70%; + height: 70%; + display: none; + position: absolute; + font-size: 14px; + border: 4px solid #FE8E14; + border-right-color: transparent; + border-radius: 50%; + color: transparent; + font-weight: 700; + animation: rotate 1s linear infinite; +} + +.home-page .logo-dynamsoft { + position: absolute; + left: 50%; + bottom: 50px; + transform: translate(-50%, -50%); + width: 130px; + height: 32px; +} + +.parsed-result-view { + position: absolute; + width: 100%; + height: 100%; + background-color: #DEDFE1; + display: none; + overflow: auto; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + border: 1px solid #E9EAEB; +} + +.parsed-result-view .barcode-text { + width: 100%; + height: 80px; + background-color: #fff; + margin-bottom: 10px; + color: #323234; + padding: 10px 27px; + font-weight: 600; + overflow: auto; + word-break: break-all; +} + +.parsed-result-view .parsed-result-list { + width: 100%; + height: fit-content; + max-height: 70%; + background-color: #fff; + overflow: auto; +} + +.parsed-result-view .parsed-result-list .parsed-result-item { + width: 100%; + height: 60px; + line-height: 60px; + padding: 0 27px; + border-bottom: 1px solid #E9EAEB; + font-size: 18px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.parsed-result-view .parsed-result-list .parsed-result-item strong { + font-weight: 500; +} + +.parsed-result-view .parsed-result-list .parsed-result-item span { + color: #666666; +} + +.parsed-result-view .back-to-scan { + width: 80%; + height: 50px; + max-width: 372px; + background-color: #FE8E14; + border-radius: 4px; + color: #FFFFFF; + font-size: 20px; + text-align: center; + line-height: 50px; + margin: 30px auto; +} + +@keyframes rotate { + to { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/scenarios/read-and-parse-GS1-AI/README.md b/scenarios/read-and-parse-GS1-AI/README.md new file mode 100644 index 00000000..1c699c4e --- /dev/null +++ b/scenarios/read-and-parse-GS1-AI/README.md @@ -0,0 +1,49 @@ +# 🔢 Read and Parse GS1 (AI) + +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. + +## Included files + +- 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. + +- scan-using-rtu-api/ — RTU implementation: + - `rtu.html` — RTU demo page. + - `rtu_gs1.json` — GS1 template file used by this implementation. + - `convert-GS1AI-title.js` — helper to convert or format AI titles for display. + - `style.css` — RTU demo styles. + - `info.svg`, `logo-dynamsoft-blackBg-190x47-DZ66W3xz.png` — visual assets used by the RTU demo. + +## ✨ Features + +- 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.). + +## 🔧 How it works + +- Both 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). +- The foundational demo is a compact single-page example that loads `read_and_parse_gs1.json` and renders parsed fields alongside the raw payload. +- The RTU demo demonstrates a more integrated UI flow (uses `rtu_gs1.json`, helper script `convert-GS1AI-title.js`, and additional assets/styles) suitable for embedding into larger apps. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- 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). +- Use the RTU implementation as a reference if you need a richer runtime UI integration. + +## 📌 Notes + +- 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.md` for running instructions, licensing and API documentation links. \ No newline at end of file diff --git a/foundational-api-samples/use-case/read-a-drivers-license/style.css b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.css similarity index 96% rename from foundational-api-samples/use-case/read-a-drivers-license/style.css rename to scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.css index acb09334..7aa64d69 100644 --- a/foundational-api-samples/use-case/read-a-drivers-license/style.css +++ b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.css @@ -43,6 +43,10 @@ strong { cursor: pointer; } +#loading { + display: none; +} + #main-container { display: flex; flex-direction: row; @@ -90,6 +94,7 @@ strong { line-height: 30px; padding-left: 10px; box-sizing: border-box; + position: relative; } #result-container .result-body { @@ -152,8 +157,9 @@ strong { .close-button { position: absolute; - top: 12px; + top: 50%; right: 15px; + transform: translateY(-50%); cursor: pointer; line-height: 0; } diff --git a/foundational-api-samples/use-case/read-a-drivers-license/index.html b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.html similarity index 72% rename from foundational-api-samples/use-case/read-a-drivers-license/index.html rename to scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.html index af5d4aa2..798586eb 100644 --- a/foundational-api-samples/use-case/read-a-drivers-license/index.html +++ b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/index.html @@ -4,16 +4,16 @@ - - - - Dynamsoft Barcode Reader Sample - Read a Driver's License - + + + + + Dynamsoft Barcode Reader Sample - Read a GS1-AI Click the play button to activate the camera. -

    Read a Driver's License

    +

    Read a GS1-AI

    @@ -37,6 +37,7 @@

    Read a Driver's License

    + Loading...
    @@ -53,8 +54,24 @@

    Read a Driver's License

    - + \ No newline at end of file diff --git a/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/read_and_parse_gs1.json b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/read_and_parse_gs1.json new file mode 100644 index 00000000..7bd4a041 --- /dev/null +++ b/scenarios/read-and-parse-GS1-AI/scan-using-foundational-api/read_and_parse_gs1.json @@ -0,0 +1,159 @@ +{ + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "task_gs1_ai_barcode", + "ExpectedBarcodesCount": 1, + "BarcodeFormatIds": [ + "BF_GS1_DATABAR", + "BF_CODE_128", + "BF_GS1_COMPOSITE" + ], + "BarcodeFormatSpecificationNameArray": [ + "bfs_gs1_ai" + ], + "SectionArray": [ + { + "Section": "ST_REGION_PREDETECTION", + "ImageParameterName": "ip_localize_barcode", + "StageArray": [ + { + "Stage": "SST_PREDETECT_REGIONS" + } + ] + }, + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip_localize_barcode", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" + }, + { + "Stage": "SST_LOCALIZE_BARCODES" + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip_decode_barcode", + "StageArray": [ + { + "Stage": "SST_RESIST_DEFORMATION" + }, + { + "Stage": "SST_COMPLEMENT_BARCODE" + }, + { + "Stage": "SST_SCALE_BARCODE_IMAGE" + }, + { + "Stage": "SST_DECODE_BARCODES" + } + ] + } + ] + } + ], + "BarcodeFormatSpecificationOptions": [ + { + "Name": "bfs_gs1_ai", + "BarcodeFormatIds": [ + "BF_GS1_DATABAR", + "BF_CODE_128", + "BF_GS1_COMPOSITE" + ], + "IncludeTrailingCheckDigit": 0, + "IncludeImpliedAI01": 1 + } + ], + "CaptureVisionTemplates": [ + { + "Name": "ReadGS1AI", + "ImageROIProcessingNameArray": [ + "roi_gs1_ai_barcode" + ], + "SemanticProcessingNameArray": [ + "sp_gs1_ai" + ] + } + ], + "ImageParameterOptions": [ + { + "Name": "ip_localize_barcode", + "ApplicableStages": [ + { + "Stage": "SST_BINARIZE_IMAGE", + "BinarizationModes": [ + { + "Mode": "BM_LOCAL_BLOCK" + } + ] + }, + { + "Stage": "SST_BINARIZE_TEXTURE_REMOVED_GRAYSCALE" + }, + { + "Stage": "SST_TRANSFORM_GRAYSCALE", + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + }, + { + "Mode": "GTM_INVERTED" + } + ] + } + ] + }, + { + "Name": "ip_decode_barcode", + "ApplicableStages": [ + { + "Stage": "SST_TRANSFORM_GRAYSCALE", + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + } + ] + }, + { + "Stage": "SST_SCALE_IMAGE", + "ImageScaleSetting": { + "ScaleType": "ST_SCALE_DOWN", + "ReferenceEdge": "RE_SHORTER_EDGE", + "EdgeLengthThreshold": 99999 + } + } + ] + } + ], + "TargetROIDefOptions": [ + { + "Name": "roi_gs1_ai_barcode", + "TaskSettingNameArray": [ + "task_gs1_ai_barcode" + ] + } + ], + "SemanticProcessingOptions": [ + { + "Name": "sp_gs1_ai", + "ReferenceObjectFilter": { + "ReferenceTargetROIDefNameArray": [ + "roi_gs1_ai_barcode" + ] + }, + "TaskSettingNameArray": [ + "dcp_gs1_ai" + ] + } + ], + "CodeParserTaskSettingOptions": [ + { + "Name": "dcp_gs1_ai", + "CodeSpecifications": [ + "GS1_AI" + ] + } + ] +} \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/convert-GS1AI-title.js b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/convert-GS1AI-title.js similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/convert-GS1AI-title.js rename to scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/convert-GS1AI-title.js diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/index.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/index.html rename to scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/index.html diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/info.svg b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/info.svg similarity index 99% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/info.svg rename to scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/info.svg index abe52645..f0dab9d4 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/info.svg +++ b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/info.svg @@ -8,4 +8,4 @@ - \ No newline at end of file + diff --git a/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/logo-dynamsoft-blackBg-190x47-DZ66W3xz.png b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/logo-dynamsoft-blackBg-190x47-DZ66W3xz.png new file mode 100644 index 00000000..7967e8ed Binary files /dev/null and b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/logo-dynamsoft-blackBg-190x47-DZ66W3xz.png differ diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/rtu_gs1.json b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/rtu_gs1.json similarity index 99% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/rtu_gs1.json rename to scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/rtu_gs1.json index cfa2bfff..67497355 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/rtu_gs1.json +++ b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/rtu_gs1.json @@ -160,4 +160,4 @@ "GlobalParameter": { "IntraOpNumThreads": 1 } -} \ No newline at end of file +} diff --git a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/style.css b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/style.css similarity index 99% rename from barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/style.css rename to scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/style.css index 5653a6f3..0cd02c7c 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/read-and-parse-GS1-AI/style.css +++ b/scenarios/read-and-parse-GS1-AI/scan-using-rtu-api/style.css @@ -197,4 +197,4 @@ body { text-align: center; } -.dm-camera-mn-toast{position:absolute;font-size:max(1.25vmin,16px);line-height:max(3vmin,32px);padding:0 max(0.5vmin,4px);left:50%;bottom:max(12.5vmin,100px);transform:translateX(-50%);color:#fff;border-radius:max(0.5vmin,4px);background:rgba(100,100,100,0.5);} \ No newline at end of file +.dm-camera-mn-toast{position:absolute;font-size:max(1.25vmin,16px);line-height:max(3vmin,32px);padding:0 max(0.5vmin,4px);left:50%;bottom:max(12.5vmin,100px);transform:translateX(-50%);color:#fff;border-radius:max(0.5vmin,4px);background:rgba(100,100,100,0.5);} diff --git a/scenarios/read-vin/README.md b/scenarios/read-vin/README.md new file mode 100644 index 00000000..8d5e220f --- /dev/null +++ b/scenarios/read-vin/README.md @@ -0,0 +1,40 @@ +# 🚗 Read a Vehicle Identification Number (VIN) + +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. + +## Included files + +- `index.html` — main demo page (camera + image/file input UI) +- `SampleVIN.jpg` — example image with a VIN barcode (or you can use your own test image) +- `read_vin.json` — JSON template used by the sample. + +## Features + +- Decode VIN barcodes from camera or static image (common 1D/2D formats used for VIN encoding) +- Validate VIN length/characters and show parsing/validation results +- Simple UI for testing images, camera input, and parsing rules + +## How it works + +- The demo initializes the barcode reader and captures either a selected image or live video frames from the camera. +- 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. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use high-resolution images or a higher camera resolution for reliable decoding and parsing. +- If a barcode isn't found, try cropping the image to the VIN region or increase camera resolution. +- VIN validation: the demo checks for 17 characters and excludes I, O, Q characters which are not used in VINs. + +## Notes + +- Serve via localhost or HTTPS to enable camera access. +- Replace the included trial/demo license with a valid Dynamsoft license for extended evaluation. +- See the repository root `README.md` for running instructions and API documentation. \ No newline at end of file diff --git a/scenarios/read-vin/SampleVIN.png b/scenarios/read-vin/SampleVIN.png new file mode 100644 index 00000000..0f5a2d22 Binary files /dev/null and b/scenarios/read-vin/SampleVIN.png differ diff --git a/scenarios/read-vin/index.html b/scenarios/read-vin/index.html new file mode 100644 index 00000000..fec16834 --- /dev/null +++ b/scenarios/read-vin/index.html @@ -0,0 +1,146 @@ + + + + + + + + + + + Dynamsoft Barcode Reader Sample - Read a VIN + + + + +
    +

    Read VIN

    +
    +
    +
    +
    + logo-dynamsoft +
    +
    +
    +
      +
      Back to Scan
      +
      + + + + \ No newline at end of file diff --git a/scenarios/read-vin/logo-dynamsoft.png b/scenarios/read-vin/logo-dynamsoft.png new file mode 100644 index 00000000..7967e8ed Binary files /dev/null and b/scenarios/read-vin/logo-dynamsoft.png differ diff --git a/scenarios/read-vin/read_vin.json b/scenarios/read-vin/read_vin.json new file mode 100644 index 00000000..0bac5cce --- /dev/null +++ b/scenarios/read-vin/read_vin.json @@ -0,0 +1,139 @@ +{ + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "task_vin_barcode", + "MaxThreadsInOneTask": 1, + "ExpectedBarcodesCount": 1, + "BarcodeFormatIds": [ + "BF_CODE_39", + "BF_CODE_128", + "BF_CODE_93", + "BF_CODABAR", + "BF_ITF", + "BF_INDUSTRIAL_25", + "BF_CODE_39_EXTENDED", + "BF_QR_CODE", + "BF_DATAMATRIX" + ], + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_SCAN_DIRECTLY" + } + ], + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" + }, + { + "Stage": "SST_LOCALIZE_BARCODES" + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "DeblurModes": [ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ], + "Stage": "SST_DECODE_BARCODES" + } + ] + } + ] + } + ], + "CaptureVisionTemplates": [ + { + "Name": "ReadVIN", + "ImageROIProcessingNameArray": [ + "roi_vin_barcode" + ] + } + ], + "ImageParameterOptions": [ + { + "Name": "ip", + "ApplicableStages": [ + { + "Stage": "SST_INPUT_COLOR_IMAGE" + }, + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "Stage": "SST_CONVERT_TO_GRAYSCALE" + }, + { + "Stage": "SST_TRANSFORM_GRAYSCALE", + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + }, + { + "Mode": "GTM_INVERTED" + } + ] + }, + { + "Stage": "SST_ENHANCE_GRAYSCALE" + }, + { + "Stage": "SST_BINARIZE_IMAGE" + }, + { + "Stage": "SST_DETECT_TEXTURE" + }, + { + "Stage": "SST_REMOVE_TEXTURE_FROM_GRAYSCALE" + }, + { + "Stage": "SST_BINARIZE_TEXTURE_REMOVED_GRAYSCALE" + }, + { + "Stage": "SST_FIND_CONTOURS" + }, + { + "Stage": "SST_DETECT_SHORTLINES" + }, + { + "Stage": "SST_ASSEMBLE_LINES" + }, + { + "Stage": "SST_DETECT_TEXT_ZONES" + }, + { + "Stage": "SST_REMOVE_TEXT_ZONES_FROM_BINARY" + } + ] + } + ], + "TargetROIDefOptions": [ + { + "Name": "roi_vin_barcode", + "TaskSettingNameArray": [ + "task_vin_barcode" + ] + } + ] +} \ No newline at end of file diff --git a/scenarios/read-vin/style.css b/scenarios/read-vin/style.css new file mode 100644 index 00000000..2326cc25 --- /dev/null +++ b/scenarios/read-vin/style.css @@ -0,0 +1,155 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif; +} + +html, +body { + width: 100%; + height: 100% +} + +.home-page { + position: absolute; + width: 100%; + height: 100%; + background-color: #323234; + z-index: 2; +} + +.home-page .home-page-title { + width: 100%; + color: white; + position: absolute; + top: 35%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 30px; + text-align: center; +} + +.home-page .start-btn { + height: 10%; + min-height: 50px; + border-radius: 50%; + background-color: #ffffff; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + aspect-ratio: 1/1; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; +} + +.home-page .start-btn .start-icon { + width: 0; + height: 0; + border-top: 15px solid transparent; + border-bottom: 15px solid transparent; + border-left: 25px solid #FE8E14; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-40%, -50%); +} + +.home-page .start-btn .loading { + width: 70%; + height: 70%; + display: none; + position: absolute; + font-size: 14px; + border: 4px solid #FE8E14; + border-right-color: transparent; + border-radius: 50%; + color: transparent; + font-weight: 700; + animation: rotate 1s linear infinite; +} + +.home-page .logo-dynamsoft { + position: absolute; + left: 50%; + bottom: 50px; + transform: translate(-50%, -50%); + width: 130px; + height: 32px; +} + +.parsed-result-view { + position: absolute; + width: 100%; + height: 100%; + background-color: #DEDFE1; + display: none; + overflow: auto; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + border: 1px solid #E9EAEB; +} + +.parsed-result-view .barcode-text { + width: 100%; + height: 80px; + background-color: #fff; + margin-bottom: 10px; + color: #323234; + padding: 10px 27px; + font-weight: 600; + overflow: auto; + word-break: break-all; + line-height: 80px; +} + +.parsed-result-view .parsed-result-list { + width: 100%; + height: fit-content; + max-height: 70%; + background-color: #fff; + overflow: auto; +} + +.parsed-result-view .parsed-result-list .parsed-result-item { + width: 100%; + height: 60px; + line-height: 60px; + padding: 0 27px; + border-bottom: 1px solid #E9EAEB; + font-size: 18px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.parsed-result-view .parsed-result-list .parsed-result-item strong { + font-weight: 500; +} + +.parsed-result-view .parsed-result-list .parsed-result-item span { + color: #666666; +} + +.parsed-result-view .back-to-scan { + width: 80%; + height: 50px; + max-width: 372px; + background-color: #FE8E14; + border-radius: 4px; + color: #FFFFFF; + font-size: 20px; + text-align: center; + line-height: 50px; + margin: 30px auto; +} + +@keyframes rotate { + to { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/scenarios/scan-1D-Industrial/README.md b/scenarios/scan-1D-Industrial/README.md new file mode 100644 index 00000000..46471497 --- /dev/null +++ b/scenarios/scan-1D-Industrial/README.md @@ -0,0 +1,40 @@ +# 🏭 Scan 1D Industrial + +A focused demo for decoding industrial-strength 1D barcodes (high-density, damaged, or specialized barcodes) using the Dynamsoft Barcode Reader (JavaScript edition). The sample demonstrates scanner tuning and UI patterns for robust 1D scanning in demanding environments. + +## Included files + +- `index.html` — main demo page (camera + UI). +- `ReadOneDIndustrial.json` — example decoder configuration used by the sample. + +## ✨ Features + +- Optimized decoding for dense or damaged 1D barcodes (industrial use) +- Live camera decoding with tuned parameters for resilience +- Example configuration file for quick parameter adjustments + +## 🔧 How it works + +- The page initializes a BarcodeScanner instance with settings optimized for industrial 1D symbols (longer decode windows, direction tolerance, damage-tolerance options). +- Decoder parameters are loaded from `ReadOneDIndustrial.json` so you can tweak thresholds, expected symbologies, and scan regions without changing application code. +- The UI accepts live camera input and shows decoded results. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Increase camera resolution and ensure steady framing for small or dense barcodes. +- Narrow the region-of-interest (ROI) to focus decoding on likely barcode areas and improve throughput. +- Use the included JSON to experiment with parameters (thresholds, expected symbologies, scan direction). + +## 📌 Notes + +- Serve via localhost or HTTPS to enable camera access. +- Replace the demo/trial license with a valid Dynamsoft license for extended evaluation or production use. +- See the repository root `README.md` for running instructions and API documentation links. \ No newline at end of file diff --git a/scenarios/scan-1D-Industrial/ReadOneDIndustrial.json b/scenarios/scan-1D-Industrial/ReadOneDIndustrial.json new file mode 100644 index 00000000..c414b31a --- /dev/null +++ b/scenarios/scan-1D-Industrial/ReadOneDIndustrial.json @@ -0,0 +1,155 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "ImageROIProcessingNameArray": [ + "ROI_Industrial" + ], + "Name": "ReadOneDIndustrial", + "MaxParallelTasks": 0, + "Timeout": 1000 + }, + { + "ImageROIProcessingNameArray": [ + "ROI_Industrial_ReadRate" + ], + "Name": "ReadOneDIndustrial_ReadRate", + "MaxParallelTasks": 0, + "Timeout": 10000 + } + ], + "TargetROIDefOptions": [ + { + "Name": "ROI_Industrial", + "TaskSettingNameArray": [ + "Task_Industrial" + ] + }, + { + "Name": "ROI_Industrial_ReadRate", + "TaskSettingNameArray": [ + "Task_Industrial_ReadRate" + ] + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "Task_Industrial", + "BarcodeFormatSpecificationNameArray": ["bfs1"], + "BarcodeFormatIds": ["BF_CODE_128", "BF_CODE_39", "BF_ITF", "BF_CODABAR", "BF_MSI_CODE"], + "ExpectedBarcodesCount":1, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_SCAN_DIRECTLY" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes":[ + { + "Mode": "DM_DIRECT_BINARIZATION" + }, + { + "Mode": "DM_NEURAL_NETWORK", + "ModelNameArray": ["Code128Decoder", "OneDDeblur"] + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + } + ] + } + ] + }, + { + "Name": "Task_Industrial_ReadRate", + "BarcodeFormatSpecificationNameArray": ["bfs1"], + "BarcodeFormatIds": ["BF_CODE_128", "BF_CODE_39", "BF_ITF", "BF_CODABAR", "BF_MSI_CODE "], + "ExpectedBarcodesCount": 999, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_SCAN_DIRECTLY" + }, + { + "Mode": "LM_NEURAL_NETWORK" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": null + } + ] + } + ] + } + ], + "BarcodeFormatSpecificationOptions": [ + { + "Name": "bfs1", + "BarcodeZoneMinDistanceToImageBorders": 10, + "MinQuietZoneWidth": 6 + } + ], + "ImageParameterOptions": [ + { + "ApplicableStages": [ + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + } + ], + "Stage": "SST_TRANSFORM_GRAYSCALE" + } + ], + "Name": "ip" + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-1D-Industrial/index.html b/scenarios/scan-1D-Industrial/index.html new file mode 100644 index 00000000..4bb51e38 --- /dev/null +++ b/scenarios/scan-1D-Industrial/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan oneD Industrial codes + + + + +

      + Scan oneD Industrial codes +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-1D-Retail/README.md b/scenarios/scan-1D-Retail/README.md new file mode 100644 index 00000000..277b2778 --- /dev/null +++ b/scenarios/scan-1D-Retail/README.md @@ -0,0 +1,37 @@ +# 🛒 Scan 1D Retail + +A demo tuned for retail 1D barcodes (UPC/EAN etc.) demonstrating speed and accuracy trade-offs for checkout-like scenarios. + +## Included files + +- `index.html` — demo page (camera + UI). +- `ReadOneDRetail.json` — example decoder configuration for retail 1D formats. + +## ✨ Features + +- Optimized decoding for common retail 1D symbologies +- Fast decode settings for high-throughput scenarios +- Example configuration for quick adjustments + +## 🔧 How it works + +- The scanner uses a retail-focused config to prioritize 1D formats and reduce unnecessary decoding overhead. +- Results appear in a compact UI suitable for POS prototyping; parameters are stored in the JSON file for easy tuning. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use fixed camera mount or consistent hand positioning for fast scans. +- Narrow ROI to the expected barcode area to improve throughput. + +## 📌 Notes + +- Serve on localhost/HTTPS to allow camera access. +- Replace the trial/demo license for extended evaluation. \ No newline at end of file diff --git a/scenarios/scan-1D-Retail/ReadOneDRetail.json b/scenarios/scan-1D-Retail/ReadOneDRetail.json new file mode 100644 index 00000000..bde1f746 --- /dev/null +++ b/scenarios/scan-1D-Retail/ReadOneDRetail.json @@ -0,0 +1,148 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "ImageROIProcessingNameArray": [ + "ROI_OneDRetail" + ], + "Name": "ReadOneDRetail", + "MaxParallelTasks": 0, + "Timeout": 1000 + }, + { + "ImageROIProcessingNameArray": [ + "ROI_OneDRetail_ReadRate" + ], + "Name": "ReadOneDRetail_ReadRate", + "MaxParallelTasks": 0, + "Timeout": 10000 + } + ], + "TargetROIDefOptions": [ + { + "Name": "ROI_OneDRetail", + "TaskSettingNameArray": [ + "Task_OneDRetail" + ] + }, + { + "Name": "ROI_OneDRetail_ReadRate", + "TaskSettingNameArray": [ + "Task_OneDRetail_ReadRate" + ] + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "Task_OneDRetail", + "BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E", "BF_GS1_DATABAR"], + "ExpectedBarcodesCount":1, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_SCAN_DIRECTLY", + "ScanDirection": 2 + }, + { + "Mode": "LM_CONNECTED_BLOCKS" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes":[ + { + "Mode": "DM_DIRECT_BINARIZATION" + }, + { + "Mode": "DM_NEURAL_NETWORK", + "ModelNameArray": ["EAN13Decoder", "OneDDeblur"] + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + } + ] + } + ] + }, + { + "Name": "Task_OneDRetail_ReadRate", + "BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E", "BF_GS1_DATABAR"], + "ExpectedBarcodesCount": 999, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_SCAN_DIRECTLY", + "ScanDirection": 2 + }, + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_NEURAL_NETWORK" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": null + } + ] + } + ] + } + ], + "ImageParameterOptions": [ + { + "ApplicableStages": [ + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + } + ], + "Stage": "SST_TRANSFORM_GRAYSCALE" + } + ], + "Name": "ip" + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-1D-Retail/index.html b/scenarios/scan-1D-Retail/index.html new file mode 100644 index 00000000..ae205c29 --- /dev/null +++ b/scenarios/scan-1D-Retail/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan oneD Retail codes + + + + +

      + Scan oneD Retail codes +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-and-search/README.md b/scenarios/scan-and-search/README.md new file mode 100644 index 00000000..e4908b8a --- /dev/null +++ b/scenarios/scan-and-search/README.md @@ -0,0 +1,39 @@ +# 🔍 Scan and Search + +A demo that scans a barcode and performs a lookup/search operation (product or inventory lookup) using the Dynamsoft Barcode Reader (JavaScript edition). + +## Included files + +- `scan-and-search.html` — single‑file demo (scan UI + search/lookup flow). + +## ✨ Features + +- Scan Barcodes using your device camera +- Search by Text or Barcode input +- Displays mock product data as search results +- Responsive UI with modern styling + +### 🔄 Sample Usage Flow + +1. Click the Scan button to launch the barcode scanner. +2. Once a barcode is detected, its value is displayed along with placeholder product information. +3. Alternatively, type a product name or barcode manually in the input field and click Search. +4. Results are displayed in the Search Result text area. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- No real backend is connected in this demo; results are mocked. +- You can integrate with a real product API by replacing the placeholder content in the searchResult.value. + +## 📌 Notes + +- Intended as a prototype UX; secure and validate lookups before production use. +- See root `README.md` for running instructions and licensing. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/scan-and-search.html b/scenarios/scan-and-search/scan-and-search.html similarity index 100% rename from barcode-scanner-api-samples/scan-single-barcode/scan-and-search.html rename to scenarios/scan-and-search/scan-and-search.html diff --git a/scenarios/scan-common-1D-and-2D/README.md b/scenarios/scan-common-1D-and-2D/README.md new file mode 100644 index 00000000..f344f7e6 --- /dev/null +++ b/scenarios/scan-common-1D-and-2D/README.md @@ -0,0 +1,31 @@ +# 🔀 Scan Any Codes + +A demo configured to detect a wide range of barcode formats (1D and 2D). Useful when you need broad-format support in one flow. + +## Included files + +- `index.html` — demo page (camera & image input). +- `ReadAllBarcodeFormats.json` — example configuration for enabling multiple formats. + +## ✨ Features + +- Detect many barcode symbologies (1D + 2D) in a single run +- Example JSON to control enabled formats + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- If performance is slow, disable seldom-used formats in the JSON config. +- Use ROI and resolution tuning to balance speed and accuracy. + +## 📌 Notes + +- Use localhost/HTTPS to enable camera access. +- Adjust the sample configuration for your target deployment. \ No newline at end of file diff --git a/scenarios/scan-common-1D-and-2D/ReadCommon1DAnd2D.json b/scenarios/scan-common-1D-and-2D/ReadCommon1DAnd2D.json new file mode 100644 index 00000000..3f4a1ac3 --- /dev/null +++ b/scenarios/scan-common-1D-and-2D/ReadCommon1DAnd2D.json @@ -0,0 +1,205 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "Name": "ReadCommon1DAnd2D", + "ImageROIProcessingNameArray": [ + "roi-read-barcodes" + ], + "Timeout": 1000, + "MaxParallelTasks": 0 + }, + { + "Name": "ReadCommon1DAnd2D_ReadRate", + "ImageROIProcessingNameArray": [ + "roi-read-barcodes-read-rate" + ], + "Timeout": 10000, + "MaxParallelTasks": 0 + } + ], + "TargetROIDefOptions": [ + { + "Name": "roi-read-barcodes", + "TaskSettingNameArray": [ + "task-read-barcodes" + ] + }, + { + "Name": "roi-read-barcodes-read-rate", + "TaskSettingNameArray": [ + "task-read-barcodes-read-rate" + ] + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "task-read-barcodes", + "ExpectedBarcodesCount": 0, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip-read-barcodes", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_SCAN_DIRECTLY" + } + ] + }, + { + "Stage": "SST_LOCALIZE_BARCODES" + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip-read-barcodes", + "StageArray": [ + { + "DeblurModes": [ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_NEURAL_NETWORK", + "ModelNameArray": [ + "Code128Decoder", + "EAN13Decoder" + ] + }, + { + "Mode": "DM_DEEP_ANALYSIS", + "Methods": ["OneDGeneral","TwoDGeneral"] + } + ], + "Stage": "SST_DECODE_BARCODES" + } + ] + } + ] + }, + { + "Name": "task-read-barcodes-read-rate", + "ExpectedBarcodesCount": 0, + "MaxThreadsInOneTask": 1, + "BarcodeFormatIds": [ + "BF_DEFAULT" + ], + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip-read-barcodes", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_NEURAL_NETWORK" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip-read-barcodes", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": [ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_DIRECT_BINARIZATION" + }, + { + "Mode": "DM_NEURAL_NETWORK" + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + }, + { + "Stage": "SST_COMPLEMENT_BARCODE", + "BarcodeComplementModes": [ + { + "Mode": "BCM_GENERAL" + } + ] + }, + { + "Stage": "SST_RESIST_DEFORMATION", + "DeformationResistingModes": [ + { + "Mode" : "DRM_AUTO" + } + ] + } + ] + } + ] + } + ], + "ImageParameterOptions": [ + { + "Name": "ip-read-barcodes", + "ApplicableStages": [ + { + "Stage": "SST_DETECT_TEXT_ZONES", + "TextDetectionMode": { + "Mode": "TTDM_LINE", + "Direction": "UNKNOWN", + "Sensitivity": 3 + } + }, + { + "Stage": "SST_REMOVE_TEXT_ZONES_FROM_BINARY", + "IfEraseTextZone": 1 + }, + { + "Stage": "SST_BINARIZE_IMAGE", + "BinarizationModes": [ + { + "Mode": "BM_LOCAL_BLOCK", + "BlockSizeX": 27, + "BlockSizeY": 27, + "EnableFillBinaryVacancy": 0 + } + ] + }, + { + "Stage": "SST_TRANSFORM_GRAYSCALE", + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + }, + { + "Mode": "GTM_INVERTED" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-common-1D-and-2D/index.html b/scenarios/scan-common-1D-and-2D/index.html new file mode 100644 index 00000000..e664ccf6 --- /dev/null +++ b/scenarios/scan-common-1D-and-2D/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan Common 1D And 2D + + + + +

      + Scan Common 1D And 2D +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-common-2D-codes/README.md b/scenarios/scan-common-2D-codes/README.md new file mode 100644 index 00000000..0aa7c011 --- /dev/null +++ b/scenarios/scan-common-2D-codes/README.md @@ -0,0 +1,37 @@ +# 🗂 Scan Common 2D Codes + +A demo focused on decoding common 2D barcode formats (QR, DataMatrix, PDF417, etc.) using the Dynamsoft Barcode Reader (JavaScript edition). + +## Included files + +- `index.html` — demo page (camera & image input). +- `ReadCommon2D.json` — example decoder configuration for common 2D formats. + +## ✨ Features + +- Prioritized decoding for frequent 2D symbologies +- Demo configuration for 2D-specific tuning (ROI, resolution) +- Example JSON to tweak decoder behavior + +## 🔧 How it works + +- The scanner loads a 2D-focused configuration and decodes frames accordingly. +- The demo displays decoded results, format metadata and provides simple controls to adjust ROI or decoder options. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Increase camera resolution for dense 2D codes. +- Limit enabled formats if you only need a subset to improve throughput. + +## 📌 Notes + +- Serve on localhost/HTTPS for camera access. +- Replace the trial/demo license with a valid license for extended testing. \ No newline at end of file diff --git a/scenarios/scan-common-2D-codes/ReadCommon2D.json b/scenarios/scan-common-2D-codes/ReadCommon2D.json new file mode 100644 index 00000000..1293ab33 --- /dev/null +++ b/scenarios/scan-common-2D-codes/ReadCommon2D.json @@ -0,0 +1,185 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "ImageROIProcessingNameArray": [ + "ROI_Common2D" + ], + "Name": "ReadCommon2D", + "MaxParallelTasks": 0, + "Timeout": 1000 + }, + { + "ImageROIProcessingNameArray": [ + "ROI_Common2D_ReadRate" + ], + "Name": "ReadCommon2D_ReadRate", + "MaxParallelTasks": 0, + "Timeout": 10000 + } + ], + "TargetROIDefOptions": [ + { + "Name": "ROI_Common2D", + "TaskSettingNameArray": [ + "Task_Common2D" + ] + }, + { + "Name": "ROI_Common2D_ReadRate", + "TaskSettingNameArray": [ + "Task_Common2D_ReadRate" + ] + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "Task_Common2D", + "BarcodeFormatIds": ["BF_QR_CODE", "BF_DATAMATRIX", "BF_PDF417"], + "ExpectedBarcodesCount":1, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_LINES" + }, + { + "Mode": "LM_NEURAL_NETWORK", + "ModelNameArray": ["DataMatrixQRCodeLocalization"] + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes":[ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + }, + { + "Stage": "SST_COMPLEMENT_BARCODE", + "BarcodeComplementModes": [ + { + "Mode": "BCM_GENERAL" + } + ] + }, + { + "Stage": "SST_RESIST_DEFORMATION", + "DeformationResistingModes": [ + { + "Mode" : "DRM_AUTO" + } + ] + } + ] + } + ] + }, + { + "Name": "Task_Common2D_ReadRate", + "BarcodeFormatIds": ["BF_QR_CODE", "BF_DATAMATRIX", "BF_PDF417"], + "ExpectedBarcodesCount": 999, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_LINES" + }, + { + "Mode": "LM_NEURAL_NETWORK", + "ModelNameArray": ["DataMatrixQRCodeLocalization"] + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": null + }, + { + "Stage": "SST_COMPLEMENT_BARCODE", + "BarcodeComplementModes": [ + { + "Mode": "BCM_GENERAL" + } + ] + }, + { + "Stage": "SST_RESIST_DEFORMATION", + "DeformationResistingModes": [ + { + "Mode" : "DRM_AUTO" + } + ] + } + ] + } + ] + } + ], + "ImageParameterOptions": [ + { + "ApplicableStages": [ + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + }, + { + "Mode": "GTM_INVERTED" + } + ], + "Stage": "SST_TRANSFORM_GRAYSCALE" + } + ], + "Name": "ip_include_inverted" + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-common-2D-codes/index.html b/scenarios/scan-common-2D-codes/index.html new file mode 100644 index 00000000..4c12a331 --- /dev/null +++ b/scenarios/scan-common-2D-codes/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan Common 2D codes + + + + +

      + Scan Common 2D codes +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-datamatrix-code/README.md b/scenarios/scan-datamatrix-code/README.md new file mode 100644 index 00000000..75092622 --- /dev/null +++ b/scenarios/scan-datamatrix-code/README.md @@ -0,0 +1,29 @@ +# Scan DataMatrix Code + +This sample demonstrates decoding DataMatrix barcodes from camera or image input using the Dynamsoft Barcode Reader (JavaScript edition). + +## Included files + +- `index.html` — Demo page (camera & image input) and UI. +- `ReadDataMatrix.json` — Example configuration used by the sample. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". This will serve the application at `http://127.0.0.1:5500/index.html`. + +3. Allow camera access when prompted and point the camera at a barcode. + +## What this sample shows + +- Enabling DataMatrix decoding and related tuning. +- Tips for scanning small or dense DataMatrix symbols. +- Using a JSON template to configure decoder behavior. + +## Notes + +- Run via HTTP(S) or localhost; opening files via `file://` may break module loading or camera permissions. +- See the repository root `README.md` for general instructions and API documentation links. \ No newline at end of file diff --git a/scenarios/scan-datamatrix-code/ReadDataMatrix.json b/scenarios/scan-datamatrix-code/ReadDataMatrix.json new file mode 100644 index 00000000..bad7fe7e --- /dev/null +++ b/scenarios/scan-datamatrix-code/ReadDataMatrix.json @@ -0,0 +1,184 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "ImageROIProcessingNameArray": [ + "ROI_DataMatrix" + ], + "Name": "ReadDataMatrix", + "MaxParallelTasks": 0, + "Timeout": 1000 + }, + { + "ImageROIProcessingNameArray": [ + "ROI_DataMatrix_ReadRate" + ], + "Name": "ReadDataMatrix_ReadRate", + "MaxParallelTasks": 0, + "Timeout": 10000 + } + ], + "TargetROIDefOptions": [ + { + "Name": "ROI_DataMatrix", + "TaskSettingNameArray": [ + "Task_DataMatrix" + ] + }, + { + "Name": "ROI_DataMatrix_ReadRate", + "TaskSettingNameArray": [ + "Task_DataMatrix_ReadRate" + ] + } + ], + "BarcodeFormatSpecificationOptions": [ + { + "BarcodeFormatIds": [ + "BF_DATAMATRIX" + ], + "EnableDataMatrixECC000-140" : 1, + "DataMatrixSizeOptions" : + [ + "DMS_ALL" + ], + "Name": "FS_0" + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "Task_DataMatrix", + "BarcodeFormatIds": ["BF_DATAMATRIX"], + "BarcodeFormatSpecificationNameArray" : ["FS_0"], + "ExpectedBarcodesCount": 1, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_LINES" + }, + { + "Mode": "LM_NEURAL_NETWORK", + "ModelNameArray": ["DataMatrixQRCodeLocalization"] + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes":[ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_THRESHOLD_BINARIZATION" + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + }, + { + "Stage": "SST_RESIST_DEFORMATION", + "DeformationResistingModes": [ + { + "Mode" : "DRM_AUTO" + } + ] + } + ] + } + ] + }, + { + "Name": "Task_DataMatrix_ReadRate", + "BarcodeFormatIds": ["BF_DATAMATRIX"], + "BarcodeFormatSpecificationNameArray" : ["FS_0"], + "ExpectedBarcodesCount":999, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_LINES" + }, + { + "Mode": "LM_NEURAL_NETWORK", + "ModelNameArray": ["DataMatrixQRCodeLocalization"] + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip_include_inverted", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": null + }, + { + "Stage": "SST_RESIST_DEFORMATION", + "DeformationResistingModes": [ + { + "Mode" : "DRM_AUTO" + } + ] + } + ] + } + ] + } + ], + "ImageParameterOptions": [ + { + "ApplicableStages": [ + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + }, + { + "Mode": "GTM_INVERTED" + } + ], + "Stage": "SST_TRANSFORM_GRAYSCALE" + } + ], + "Name": "ip_include_inverted" + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-datamatrix-code/index.html b/scenarios/scan-datamatrix-code/index.html new file mode 100644 index 00000000..d8d349b4 --- /dev/null +++ b/scenarios/scan-datamatrix-code/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan DataMatrix codes + + + + +

      + Scan DataMatrix codes +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-from-distance/README.md b/scenarios/scan-from-distance/README.md new file mode 100644 index 00000000..02b79095 --- /dev/null +++ b/scenarios/scan-from-distance/README.md @@ -0,0 +1,36 @@ +# 🔭 Scan From Distance + +A demo that demonstrates techniques for scanning barcodes from a distance (ROI, zoom and resolution tuning) using the Dynamsoft Barcode Reader (JavaScript edition). + +## Included files + +- `index.html` — demo page (camera + UI). +- `ReadDistantBarcodes.json` — example configuration used by the sample. + +## ✨ Features + +- Camera/ROI/decoder tuning for distant targets +- Example configuration for resolution and ROI adjustments + +## 🔧 How it works + +- The demo adjusts camera resolution and ROI to favor distant targets, and exposes decoder parameters to improve detection at smaller apparent sizes. +- The sample shows common trade-offs and provides an example JSON to reproduce settings. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use a tripod or stable mount for distant scanning. +- Increase camera resolution and narrow ROI to target likely barcode areas. + +## 📌 Notes + +- Serve on localhost/HTTPS to enable camera access. +- For production, pair software tuning with suitable optics/camera hardware. \ No newline at end of file diff --git a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDPM.json b/scenarios/scan-from-distance/ReadDistantBarcodes.json similarity index 66% rename from barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDPM.json rename to scenarios/scan-from-distance/ReadDistantBarcodes.json index ec54f7e2..2e1b3527 100644 --- a/barcode-scanner-api-samples/scan-single-barcode/use-customized-template/ReadDPM.json +++ b/scenarios/scan-from-distance/ReadDistantBarcodes.json @@ -1,37 +1,24 @@ { + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, "BarcodeReaderTaskSettingOptions": [ { - "BarcodeFormatIds": [ - "BF_DATAMATRIX" - ], - "DPMCodeReadingModes": [ - { - "Mode": "DPMCRM_GENERAL" - } - ], "ExpectedBarcodesCount": 1, - "Name": "task_read_dpm", + "Name": "task_read_distant_barcodes", "SectionArray": [ { - "ImageParameterName": "ip_read_dpm", - "Section": "ST_REGION_PREDETECTION", - "StageArray": [ - { - "Stage": "SST_PREDETECT_REGIONS" - } - ] - }, - { - "ImageParameterName": "ip_read_dpm", + "ImageParameterName": "ip_read_distant_barcodes", "Section": "ST_BARCODE_LOCALIZATION", "StageArray": [ { "LocalizationModes": [ { - "Mode": "LM_STATISTICS_MARKS" + "Mode": "LM_CONNECTED_BLOCKS" }, { - "Mode": "LM_CONNECTED_BLOCKS" + "Mode": "LM_NEURAL_NETWORK" } ], "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES" @@ -42,7 +29,7 @@ ] }, { - "ImageParameterName": "ip_read_dpm", + "ImageParameterName": "ip_read_distant_barcodes", "Section": "ST_BARCODE_DECODING", "StageArray": [ { @@ -52,6 +39,13 @@ "Stage": "SST_COMPLEMENT_BARCODE" }, { + "BarcodeScaleModes": [ + { + "Mode": "BSM_LINEAR_INTERPOLATION", + "ModuleSizeThreshold": 4, + "TargetModuleSize": 6 + } + ], "Stage": "SST_SCALE_BARCODE_IMAGE" }, { @@ -76,9 +70,11 @@ "CaptureVisionTemplates": [ { "ImageROIProcessingNameArray": [ - "roi_read_dpm" + "roi_read_distant_barcodes" ], - "Name": "ReadDPM" + "MaxParallelTasks": 0, + "Name": "ReadDistantBarcodes", + "Timeout": 5000 } ], "ImageParameterOptions": [ @@ -88,6 +84,10 @@ "Stage": "SST_INPUT_COLOR_IMAGE" }, { + "ImageScaleSetting": { + "EdgeLengthThreshold": 10000, + "ScaleType": "ST_SCALE_DOWN" + }, "Stage": "SST_SCALE_IMAGE" }, { @@ -127,15 +127,29 @@ "Stage": "SST_REMOVE_TEXT_ZONES_FROM_BINARY" } ], - "Name": "ip_read_dpm" + "Name": "ip_read_distant_barcodes" } ], "TargetROIDefOptions": [ { - "Name": "roi_read_dpm", + "Name": "roi_read_distant_barcodes", "TaskSettingNameArray": [ - "task_read_dpm" + "task_read_distant_barcodes" ] } + ], + "CaptureVisionModelOptions": [ + { + "Name": "OneDLocalization", + "ModelArgs": { + "ImageDimensionThreshold": 3000000 + } + }, + { + "Name": "DataMatrixQRCodeLocalization", + "ModelArgs": { + "ImageDimensionThreshold": 3000000 + } + } ] } \ No newline at end of file diff --git a/scenarios/scan-from-distance/index.html b/scenarios/scan-from-distance/index.html new file mode 100644 index 00000000..2eff87f8 --- /dev/null +++ b/scenarios/scan-from-distance/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan From Distance + + + + +

      + Scan From Distance +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/scan-qr-code/README.md b/scenarios/scan-qr-code/README.md new file mode 100644 index 00000000..2b52cd4b --- /dev/null +++ b/scenarios/scan-qr-code/README.md @@ -0,0 +1,37 @@ +# 📱 Scan QR Code + +A focused demo for scanning QR codes from camera video or static images using the Dynamsoft Barcode Reader (JavaScript edition). Demonstrates QR-specific tuning and configuration. + +## Included files + +- `index.html` — demo page (camera & image input). +- `ReadQR.json` — sample configuration/template used by the demo. + +## ✨ Features + +- Targeted QR decoding for improved performance +- Camera and static image input support +- Loadable JSON configuration for decoder settings + +## 🔧 How it works + +- The demo configures the scanner to prioritize QR decoding and applies ROI/resolution adjustments for common QR scenarios. +- Decoded payloads are displayed; configuration can be adjusted via `ReadQR.json`. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- For small QR symbols increase camera resolution or reduce ROI. +- Good lighting and steady framing improves decode reliability. + +## 📌 Notes + +- Serve via localhost/HTTPS for camera permissions. +- Replace trial/demo license with a valid Dynamsoft license for extended use. \ No newline at end of file diff --git a/scenarios/scan-qr-code/ReadQR.json b/scenarios/scan-qr-code/ReadQR.json new file mode 100644 index 00000000..7c90b111 --- /dev/null +++ b/scenarios/scan-qr-code/ReadQR.json @@ -0,0 +1,153 @@ +{ + "GlobalParameter": + { + "IntraOpNumThreads": 2 + }, + "CaptureVisionTemplates": [ + { + "ImageROIProcessingNameArray": [ + "ROI_QR" + ], + "Name": "ReadQR", + "MaxParallelTasks": 0, + "Timeout": 1000 + }, + { + "ImageROIProcessingNameArray": [ + "ROI_QR_ReadRate" + ], + "Name": "ReadQR_ReadRate", + "MaxParallelTasks": 0, + "Timeout": 10000 + } + ], + "TargetROIDefOptions": [ + { + "Name": "ROI_QR", + "TaskSettingNameArray": [ + "Task_QR" + ] + }, + { + "Name": "ROI_QR_ReadRate", + "TaskSettingNameArray": [ + "Task_QR_ReadRate" + ] + } + ], + "BarcodeFormatSpecificationOptions": [ + { + "BarcodeFormatIds": [ + "BF_QR_CODE" + ], + "EnableQRCodeModel1" : 1, + "Name": "FS_0" + } + ], + "BarcodeReaderTaskSettingOptions": [ + { + "Name": "Task_QR", + "BarcodeFormatIds": ["BF_QR_CODE"], + "BarcodeFormatSpecificationNameArray" : ["FS_0"], + "ExpectedBarcodesCount":1, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes":[ + { + "Mode": "DM_BASED_ON_LOC_BIN" + }, + { + "Mode": "DM_DIRECT_BINARIZATION" + }, + { + "Mode": "DM_DEEP_ANALYSIS" + } + ] + } + ] + } + ] + }, + { + "Name": "Task_QR_ReadRate", + "BarcodeFormatIds": ["BF_QR_CODE"], + "BarcodeFormatSpecificationNameArray" : ["FS_0"], + "ExpectedBarcodesCount": 999, + "MaxThreadsInOneTask": 1, + "SectionArray": [ + { + "Section": "ST_BARCODE_LOCALIZATION", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_LOCALIZE_CANDIDATE_BARCODES", + "LocalizationModes": [ + { + "Mode": "LM_CONNECTED_BLOCKS" + }, + { + "Mode": "LM_LINES" + }, + { + "Mode": "LM_NEURAL_NETWORK" + } + ] + } + ] + }, + { + "Section": "ST_BARCODE_DECODING", + "ImageParameterName": "ip", + "StageArray": [ + { + "Stage": "SST_DECODE_BARCODES", + "DeblurModes": null + } + ] + } + ] + } + ], + "ImageParameterOptions": [ + { + "ApplicableStages": [ + { + "ImageScaleSetting": { + "EdgeLengthThreshold": 100000, + "ScaleType": "ST_SCALE_DOWN" + }, + "Stage": "SST_SCALE_IMAGE" + }, + { + "GrayscaleTransformationModes": [ + { + "Mode": "GTM_ORIGINAL" + } + ], + "Stage": "SST_TRANSFORM_GRAYSCALE" + } + ], + "Name": "ip" + } + ] +} \ No newline at end of file diff --git a/scenarios/scan-qr-code/index.html b/scenarios/scan-qr-code/index.html new file mode 100644 index 00000000..95a6ecc8 --- /dev/null +++ b/scenarios/scan-qr-code/index.html @@ -0,0 +1,103 @@ + + + + + + + + Dynamsoft Barcode Scanner Sample - Scan QR codes + + + + +

      + Scan QR codes +

      + +
      + + + + + + + + + + + + + \ No newline at end of file diff --git a/scenarios/show-result-texts-on-the-video/README.md b/scenarios/show-result-texts-on-the-video/README.md new file mode 100644 index 00000000..a72116e8 --- /dev/null +++ b/scenarios/show-result-texts-on-the-video/README.md @@ -0,0 +1,32 @@ +# 🎥 Show Result Texts on the Video + +A demo that overlays decoded barcode text directly onto the live camera video. Useful for UX patterns that require visual confirmation of decoded results in context. + +## Included files + +- `show-result-texts-on-the-video.html` — demo page that overlays decoded text on video. + +## ✨ Features + +- Live camera decoding with on‑video text overlays +- Map decoded bounding boxes to overlay positions +- Visual feedback for multiple simultaneous detections + +## 🔧 How it works + +- The scanner decodes frames and returns results with coordinates. +- The demo maps result coordinates to the video element and renders text labels/boxes at the corresponding positions. +- Labels update in real time as the scanner finds or loses targets. + +## Quick start + +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/): + +1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace. + +2. Right-click on `index.html` and select "Open with Five Server". + +## 💡 Tips + +- Use steady lighting and keep barcodes within the camera view for stable overlays. +- Run on localhost/HTTPS to allow camera access. \ No newline at end of file diff --git a/foundational-api-samples/use-case/show-result-texts-on-the-video.html b/scenarios/show-result-texts-on-the-video/show-result-texts-on-the-video.html similarity index 100% rename from foundational-api-samples/use-case/show-result-texts-on-the-video.html rename to scenarios/show-result-texts-on-the-video/show-result-texts-on-the-video.html