diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 125a0a7..0000000 --- a/.gitignore +++ /dev/null @@ -1,60 +0,0 @@ -.DS_Store -node_modules -build -/Test* - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? -*.map -*.properties - -__pycache__ -~~* ---* -==* -package-lock.json -yarn.lock -.git -.npmrc -/*.zip -/*.py -/*.exe -/*.jar -/*.md -/*.html -/*.json -/*.js -/*.txt -/.gitattributes -/.*ignore -/dynamsoft-barcode-reader-js-* -/sampleFromGithub -/src -/doc -/Web.config -/samples -/temp -/templates -/public -/README.html - -!/LEGAL.txt -!/README.md -!/README.NODE.md -!/package.json -!/LICENSE diff --git a/API Reference.url b/API Reference.url index e7b9f0a..b3a5e54 100644 --- a/API Reference.url +++ b/API Reference.url @@ -1,2 +1,2 @@ [InternetShortcut] -URL=https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=10.0.21 \ No newline at end of file +URL=https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=10.2.10 \ No newline at end of file diff --git a/README.md b/README.md index e8ce37f..6dcc265 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In this guide, you will learn step by step on how to integrate the DBR-JS SDK in - [Building your own page](#building-your-own-page) - [Include the SDK](#include-the-sdk) - [Use a public CDN](#use-a-public-cdn) - - [Host the SDK yourself](#host-the-sdk-yourself) + - [Host the SDK yourself (optional)](#host-the-sdk-yourself-optional) - [Prepare the SDK](#prepare-the-sdk) - [Specify the license](#specify-the-license) - [Specify the location of the "engine" files (optional)](#specify-the-location-of-the-engine-files-optional) @@ -54,22 +54,21 @@ In this guide, you will learn step by step on how to integrate the DBR-JS SDK in **Popular Examples** - -- Hello World - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/hello-world/hello-world.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.0.21&utm_source=github) -- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/hello-world/?ver=10.0.21&utm_source=github) -- React App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/hello-world/react) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.0.21&utm_source=github) -- Vue App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/hello-world/vue) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.0.21&utm_source=github) -- PWA App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/hello-world/pwa) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.0.21&utm_source=github) -- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.0.21/hello-world/webview) -- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/use-case/read-a-drivers-license.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?ver=10.0.21&utm_source=github) -- Fill A Form - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/use-case/fill-a-form-with-barcode-reading.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?ver=10.0.21&utm_source=github) -- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/use-case/show-result-texts-on-the-video.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/use-case/show-result-texts-on-the-video.html?ver=10.0.21&utm_source=github) -- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.21/others/debug) +- Hello World - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/hello-world.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=github) +- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/hello-world/?ver=10.2.10&utm_source=github) +- React App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/react) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.2.10&utm_source=github) +- Vue App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/vue) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.2.10&utm_source=github) +- PWA App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/pwa) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.2.10&utm_source=github) +- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/hello-world/webview) +- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?ver=10.2.10&utm_source=github) +- Fill A Form - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/fill-a-form-with-barcode-reading.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?ver=10.2.10&utm_source=github) +- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/show-result-texts-on-the-video.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/use-case/show-result-texts-on-the-video.html?ver=10.2.10&utm_source=github) +- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/others/debug) You can also: -- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=10.0.21&utm_source=github) \| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/) -- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=10.0.21&utm_source=github) \| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.0.21/) +- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=10.2.10&utm_source=github) \| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-demo/) +- Try Online Examples - [Run](https://demo.dynamsoft.com/Samples/DBR/JS/index.html?ver=10.2.10&utm_source=github) \| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/) ## Hello World - Simplest Implementation @@ -88,11 +87,12 @@ The complete code of the "Hello World" example is shown below
- + - - - - - + + + + + + ``` Or just ```html - + ``` - UNPKG ```html - - - - - - + + + + + + ``` Or just ```html - + ``` In some rare cases (such as some restricted areas), you might not be able to access the CDN. If this happens, you can use the following files for the test. -- https://download2.dynamsoft.com/packages/dynamsoft-core@3.0.33/dist/core.js -- https://download2.dynamsoft.com/packages/dynamsoft-license@3.0.40/dist/license.js -- https://download2.dynamsoft.com/packages/dynamsoft-utility@1.0.21/dist/utility.js -- https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.0.21/dist/dbr.js -- https://download2.dynamsoft.com/packages/dynamsoft-capture-vision-router@2.0.32/dist/cvr.js -- https://download2.dynamsoft.com/packages/dynamsoft-camera-enhancer@4.0.1/dist/dce.js -- or bundle: https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.0.21/dist/dbr.bundle.js +- https://download2.dynamsoft.com/packages/dynamsoft-core@3.2.10/dist/core.js +- https://download2.dynamsoft.com/packages/dynamsoft-license@3.2.10/dist/license.js +- https://download2.dynamsoft.com/packages/dynamsoft-utility@1.2.10/dist/utility.js +- https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.2.10/dist/dbr.js +- https://download2.dynamsoft.com/packages/dynamsoft-capture-vision-router@2.2.10/dist/cvr.js +- https://download2.dynamsoft.com/packages/dynamsoft-camera-enhancer@4.0.2/dist/dce.js +- or bundle: https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader@10.2.10/dist/dbr.bundle.js However, please **DO NOT** use `download2.dynamsoft.com` resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself. -#### Host the SDK yourself +#### Host the SDK yourself (optional) Besides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application. @@ -272,78 +268,69 @@ Options to download the SDK: - From the website - [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.0.21&utm_source=github&product=dbr&package=js) + [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=github&product=dbr&package=js) - yarn ```cmd - yarn add dynamsoft-core@3.0.33 --save - yarn add dynamsoft-license@3.0.40 --save - yarn add dynamsoft-utility@1.0.21 --save - yarn add dynamsoft-barcode-reader@10.0.21 --save - yarn add dynamsoft-capture-vision-router@2.0.32 --save - yarn add dynamsoft-camera-enhancer@4.0.1 --save - yarn add dynamsoft-capture-vision-std@1.0.0 --save - yarn add dynamsoft-image-processing@2.0.30 --save + yarn add dynamsoft-core@3.2.10 --save + yarn add dynamsoft-license@3.2.10 --save + yarn add dynamsoft-utility@1.2.10 --save + yarn add dynamsoft-barcode-reader@10.2.10 --save + yarn add dynamsoft-capture-vision-router@2.2.10 --save + yarn add dynamsoft-camera-enhancer@4.0.2 --save + yarn add dynamsoft-capture-vision-std@1.2.0 --save + yarn add dynamsoft-image-processing@2.2.10 --save ``` - npm ```cmd - npm install dynamsoft-core@3.0.33 --save - npm install dynamsoft-license@3.0.40 --save - npm install dynamsoft-utility@1.0.21 --save - npm install dynamsoft-barcode-reader@10.0.21 --save - npm install dynamsoft-capture-vision-router@2.0.32 --save - npm install dynamsoft-camera-enhancer@4.0.1 --save - npm install dynamsoft-capture-vision-std@1.0.0 --save - npm install dynamsoft-image-processing@2.0.30 --save + npm install dynamsoft-core@3.2.10 --save + npm install dynamsoft-license@3.2.10 --save + npm install dynamsoft-utility@1.2.10 --save + npm install dynamsoft-barcode-reader@10.2.10 --save + npm install dynamsoft-capture-vision-router@2.2.10 --save + npm install dynamsoft-camera-enhancer@4.0.2 --save + npm install dynamsoft-capture-vision-std@1.2.0 --save + npm install dynamsoft-image-processing@2.2.10 --save ``` -Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this: - -```html - - - - - - -``` +Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this -Or just +- From the website -```html - -``` + ```html + + + + + + + ``` -or + Or just -```html - - - - - - -``` + ```html + + ``` -Or just +- yarn or npm -```html - -``` + ```html + + + + + + + ``` -or + Or just -```typescript -import { CoreModule, EnumCapturedResultItemType } from 'dynamsoft-core' -import { LicenseManager } from 'dynamsoft-license'; -import { CapturedResultReceiver, CaptureVisionRouter, type SimplifiedCaptureVisionSettings } from "dynamsoft-capture-vision-router"; -import { CameraEnhancer, CameraView } from "dynamsoft-camera-enhancer"; -import { DecodedBarcodesResult } from 'dynamsoft-barcode-reader'; -import { MultiFrameResultCrossFilter } from 'dynamsoft-utility'; -``` + ```html + + ``` *Note*: @@ -374,7 +361,7 @@ To enable the SDK's functionality, you must provide a valid license. Utilize the Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); ``` -As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=10.0.21&utm_source=github&product=dbr&package=js). +As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?ver=10.2.10&utm_source=github&product=dbr&package=js). > Upon registering a Dynamsoft account and obtaining the SDK package from the official website, Dynamsoft will automatically create a 30-day free trial license and embed the corresponding license key into all the provided SDK samples. @@ -387,14 +374,13 @@ The purpose is to tell the SDK where to find the engine files (\*.worker.js, \*. ```javascript //The following code uses the jsDelivr CDN, feel free to change it to your own location of these files Object.assign(Dynamsoft.Core.CoreModule.engineResourcePaths, { - std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.0.0/dist/", - dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.0.30/dist/", - core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.0.33/dist/", - license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.0.40/dist/", - cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.0.32/dist/", - dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.0.21/dist/", - dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.1/dist/", - utility: "https://cdn.jsdelivr.net/npm/dynamsoft-utility@1.0.21/dist/" + std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.0/dist/", + dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.10/dist/", + core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.10/dist/", + license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.10/dist/", + cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.10/dist/", + dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/", + dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.2/dist/" }); ``` @@ -406,7 +392,7 @@ The image processing logic is encapsulated within .wasm library files, and these ```js // Preload the .wasm files -await Dynamsoft.Core.CoreModule.loadWasm(["cvr", "dbr"]); +await Dynamsoft.Core.CoreModule.loadWasm(["dbr"]); ``` #### Create a CaptureVisionRouter object @@ -426,17 +412,17 @@ try { *Tip*: -When creating a `CaptureVisionRouter` object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as `tempRouter` in the following code +When creating a `CaptureVisionRouter` object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as `pRouter` in the following code: ```javascript Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); -let tempRouter = null; +let pRouter = null; // promise of router let router = null; document.getElementById('btn-scan').addEventListener('click', async () => { try { - router = await (tempRouter = tempRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance()); + router = await (pRouter = pRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance()); } catch (ex) { console.error(ex); } @@ -494,7 +480,7 @@ router.addResultReceiver({ onDecodedBarcodesReceived: (result) => { }}); ``` -Check out [CapturedResultReceiver](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/captured-result-receiver.html) for more information. +Check out [CapturedResultReceiver](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/captured-result-receiver.html) for more information. #### Start the process @@ -523,6 +509,8 @@ await router.startCapturing("ReadSingleBarcode"); | **ReadDenseBarcodes** | Specialized in reading barcodes with high information density. | | **ReadDistantBarcodes** | Capable of reading barcodes from extended distances. | +Read more on the [preset CaptureVisionTemplates](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/preset-templates.html). + ### Customize the process #### Adjust the preset template settings @@ -570,8 +558,7 @@ Please be aware that it is necessary to update the `CapturedResultReceiver` obje ```javascript resultReceiver.onCapturedResultReceived = (result) => { - let barcodes = result.items.filter( - (item) => + let barcodes = result.items.filter((item) => item.type === Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE ); if (barcodes.length > 0) { @@ -651,7 +638,7 @@ await router.startCapturing("ReadSingleBarcode"); The preset templates have a lot more settings that can be customized to best suit your use case. If you [download the SDK from Dynamsoft website](https://www.dynamsoft.com/barcode-reader/downloads/1000003-confirmation/), you can find the templates under -* "/dynamsoft-barcode-reader-js-10.0.21/dynamsoft/resources/barcode-reader/templates/" +* "/dynamsoft-barcode-reader-js-10.2.10/dynamsoft/resources/barcode-reader/templates/" Upon completing the template editing, you can invoke the `initSettings` method and provide it with the template path as an argument. @@ -668,9 +655,7 @@ While processing video frames, it's common for the same barcode to be detected m ```js let filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter(); -filter.enableResultCrossVerification( - Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE, true -); +filter.enableResultCrossVerification("barcode", true); await router.addResultFilter(filter); ``` @@ -682,9 +667,7 @@ await router.addResultFilter(filter); ```js let filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter(); -filter.enableResultDeduplication( - Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE, true -); +filter.enableResultDeduplication("barcode", true); await router.addResultFilter(filter); ``` @@ -694,7 +677,7 @@ await router.addResultFilter(filter); Initially, the filter is set to forget a result 3 seconds after it is first received. During this time frame, if an identical result appears, it is ignored. -> It's important to know that in version 9.x or earlier, the occurrence of an identical result would reset the timer, thus reinitiating the 3-second count at that point. However, in version 10.0.21 and later, an identical result no longer resets the timer but is instead disregarded, and the duration count continues uninterrupted. +> It's important to know that in version 9.x or earlier, the occurrence of an identical result would reset the timer, thus reinitiating the 3-second count at that point. However, in version 10.2.10 and later, an identical result no longer resets the timer but is instead disregarded, and the duration count continues uninterrupted. Under certain circumstances, this duration can be extended with the method `setDuplicateForgetTime()`. @@ -708,12 +691,8 @@ You can also enable both options at the same time: ```js let filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter(); -filter.enableResultCrossVerification( - Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE, true -); -filter.enableResultDeduplication( - Dynamsoft.Core.EnumCapturedResultItemType.CRIT_BARCODE, true -); +filter.enableResultCrossVerification("barcode", true); +filter.enableResultDeduplication("barcode", true); filter.setDuplicateForgetTime(5000); await router.addResultFilter(filter); ``` @@ -741,7 +720,7 @@ The UI is part of the auxiliary SDK "Dynamsoft Camera Enhancer", read more on ho ## API Documentation You can check out the detailed documentation about the APIs of the SDK at -[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=10.0.21](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=10.0.21). +[https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=10.2.10](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=10.2.10). ## System Requirements @@ -783,15 +762,15 @@ Apart from the browsers, the operating systems may impose some limitations of th ## How to Upgrade -If you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/index.html?ver=10.0.21&utm_source=github). +If you want to upgrade the SDK from an old version to a newer one, please see [how to upgrade](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/upgrade-guide/index.html?ver=10.2.10&utm_source=github). ## Release Notes -Learn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/index.html](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/index.html?ver=10.0.21&utm_source=github). +Learn about what are included in each release at [https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/index.html](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/release-notes/index.html?ver=10.2.10&utm_source=github). ## Next Steps Now that you have got the SDK integrated, you can choose to move forward in the following directions -1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=10.0.21) -2. Learn about the [APIs of the SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/index.html?ver=10.0.21) +1. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=10.2.10) +2. Learn about the [APIs of the SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/index.html?ver=10.2.10) diff --git a/dist/dbr.bundle.js b/dist/dbr.bundle.js index 43db984..cbbaa9c 100644 --- a/dist/dbr.bundle.js +++ b/dist/dbr.bundle.js @@ -4,59 +4,58 @@ * @website http://www.dynamsoft.com * @copyright Copyright 2024, Dynamsoft Corporation * @author Dynamsoft -* @version 10.0.21 +* @version 10.2.10 * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on dbr JS: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/ */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Dynamsoft={})}(this,(function(t){"use strict"; /*! - * Dynamsoft JavaScript Library - * @product Dynamsoft Core JS Edition - * @website https://www.dynamsoft.com - * @copyright Copyright 2024, Dynamsoft Corporation - * @author Dynamsoft - * @version 3.0.33 - * @fileoverview Dynamsoft JavaScript Library for Core - * More info on Dynamsoft Core JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html - */function e(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function i(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i}var n,r,s;"function"==typeof SuppressedError&&SuppressedError,function(t){t[t.BOPM_BLOCK=0]="BOPM_BLOCK",t[t.BOPM_UPDATE=1]="BOPM_UPDATE"}(n||(n={})),function(t){t[t.CCUT_AUTO=0]="CCUT_AUTO",t[t.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",t[t.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",t[t.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",t[t.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",t[t.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(r||(r={})),function(t){t[t.IPF_BINARY=0]="IPF_BINARY",t[t.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",t[t.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",t[t.IPF_NV21=3]="IPF_NV21",t[t.IPF_RGB_565=4]="IPF_RGB_565",t[t.IPF_RGB_555=5]="IPF_RGB_555",t[t.IPF_RGB_888=6]="IPF_RGB_888",t[t.IPF_ARGB_8888=7]="IPF_ARGB_8888",t[t.IPF_RGB_161616=8]="IPF_RGB_161616",t[t.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",t[t.IPF_ABGR_8888=10]="IPF_ABGR_8888",t[t.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",t[t.IPF_BGR_888=12]="IPF_BGR_888",t[t.IPF_BINARY_8=13]="IPF_BINARY_8",t[t.IPF_NV12=14]="IPF_NV12"}(s||(s={}));const o=t=>Object.prototype.toString.call(t),a=t=>Array.isArray?Array.isArray(t):"[object Array]"===o(t),h=t=>"[object Boolean]"===o(t),l=t=>"number"==typeof t&&!Number.isNaN(t),c=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),u=t=>!(!c(t)||!(t.bytes instanceof Uint8Array)||!l(t.width)||t.width<=0||!l(t.height)||t.height<=0||!l(t.stride)||t.stride<=0||!("format"in t)||"tag"in t&&!f(t.tag)),d=t=>!(!c(t)||!l(t.left)||t.left<0||!l(t.top)||t.top<0||!l(t.right)||t.right<0||!l(t.bottom)||t.bottom<0||t.left>=t.right||t.top>=t.bottom||!h(t.isMeasuredInPercentage)),f=t=>!!c(t)&&!!l(t.imageId)&&"type"in t,g=t=>!(!c(t)||!_(t.startPoint)||!_(t.endPoint)||t.startPoint.x==t.endPoint.x&&t.startPoint.y==t.endPoint.y),_=t=>!!c(t)&&!!l(t.x)&&!!l(t.y),p=t=>!!c(t)&&!!a(t.points)&&0!=t.points.length&&!t.points.some((t=>!_(t))),m=t=>!!c(t)&&!!a(t.points)&&0!=t.points.length&&4==t.points.length&&!t.points.some((t=>!_(t))),v=t=>!(!c(t)||!l(t.x)||!l(t.y)||!l(t.width)||t.width<0||!l(t.height)||t.height<0||"isMeasuredInPercentage"in t&&!h(t.isMeasuredInPercentage));const y=(t,e)=>{let i=t.split("."),n=e.split(".");for(let t=0;t