diff --git a/API Reference.url b/API Reference.url index 70281bd..e7b9f0a 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.20 +URL=https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/?ver=10.0.21 \ No newline at end of file diff --git a/LEGAL.txt b/LEGAL.txt index 156e3a9..7fea86c 100644 --- a/LEGAL.txt +++ b/LEGAL.txt @@ -350,4 +350,4 @@ Leptonica - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *====================================================================*/ -=================================================================================== +=================================================================================== \ No newline at end of file diff --git a/README.md b/README.md index a7b539c..e8ce37f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # Barcode Reader for Your Website - User Guide -[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/){:target="_blank"} (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code. +[Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/) (DBR-JS) is equipped with industry-leading algorithms for exceptional speed, accuracy and read rates in barcode reading. Using its well-designed API, you can turn your web page into a barcode scanner with just a few lines of code.    - + + + + Once the DBR-JS SDK gets integrated into your web page, your users can access a camera via the browser and read barcodes directly from its video input. @@ -52,21 +55,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.20/hello-world/hello-world.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.0.20&utm_source=github) -- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/hello-world/?ver=10.0.20&utm_source=github) -- React App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/hello-world/react) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.0.20&utm_source=github) -- Vue App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/hello-world/vue) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.0.20&utm_source=github) -- PWA App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/hello-world/pwa) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.0.20&utm_source=github) -- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.0.20/hello-world/webview) -- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/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.20&utm_source=github) -- Fill A Form - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/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.20&utm_source=github) -- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/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.20&utm_source=github) -- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.0.20/others/debug) +- 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) You can also: -- Try the Official Demo - [Run](https://demo.dynamsoft.com/barcode-reader-js/?ver=10.0.20&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.20&utm_source=github) \| [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.0.20/) +- 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/) ## Hello World - Simplest Implementation @@ -85,12 +88,7 @@ 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.32/dist/core.js -- https://download2.dynamsoft.com/packages/dynamsoft-license@3.0.20/dist/license.js +- 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.20/dist/dbr.js -- https://download2.dynamsoft.com/packages/dynamsoft-capture-vision-router@2.0.31/dist/cvr.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 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. @@ -259,16 +272,16 @@ Options to download the SDK: - From the website - [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.0.20&utm_source=github&product=dbr&package=js){:target="_blank"} + [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.0.21&utm_source=github&product=dbr&package=js) - yarn ```cmd - yarn add dynamsoft-core@3.0.32 --save - yarn add dynamsoft-license@3.0.20 --save + 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.20 --save - yarn add dynamsoft-capture-vision-router@2.0.31 --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 @@ -277,11 +290,11 @@ Options to download the SDK: - npm ```cmd - npm install dynamsoft-core@3.0.32 --save - npm install dynamsoft-license@3.0.20 --save + 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.20 --save - npm install dynamsoft-capture-vision-router@2.0.31 --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 @@ -290,14 +303,20 @@ Options to download the SDK: Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this: ```html - - + + - - + + ``` +Or just + +```html + +``` + or ```html @@ -309,14 +328,21 @@ or ``` +Or just + +```html + +``` + or ```typescript -import { EnumCapturedResultItemType, type DSImageData } from "dynamsoft-core"; -import { LicenseManager } from "dynamsoft-license"; -import { type BarcodeResultItem } from "dynamsoft-barcode-reader"; +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'; ``` *Note*: @@ -324,9 +350,9 @@ import { CameraEnhancer, CameraView } from "dynamsoft-camera-enhancer"; * Certain legacy web application servers may lack support for the `application/wasm` mimetype for .wasm files. To address this, you have two options: 1. Upgrade your web application server to one that supports the `application/wasm` mimetype. 2. Manually define the mimetype on your server. You can refer to the following resources for guidance: - 1. [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings){:target="_blank"} - 2. [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap){:target="_blank"} - 3. [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types){:target="_blank"} + 1. [Apache](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Apache_Configuration_htaccess#media_types_and_character_encodings) + 2. [IIS](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap) + 3. [Nginx](https://www.nginx.com/resources/wiki/start/topics/examples/full/#mime-types) * To work properly, the SDK requires a few engine files, which are relatively large and may take quite a few seconds to download. We recommend that you set a longer cache time for these engine files, to maximize the performance of your web application. @@ -334,7 +360,7 @@ import { CameraEnhancer, CameraView } from "dynamsoft-camera-enhancer"; Cache-Control: max-age=31536000 ``` - Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control){:target="_blank"}. + Reference: [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). ### Prepare the SDK @@ -348,7 +374,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.20&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.0.21&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. @@ -360,14 +386,16 @@ 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 -Dynamsoft.Core.CoreModule.engineResourcePaths.core = "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.0.32/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.license = "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.0.20/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.dbr = "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.0.20/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.cvr = "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.0.31/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.dce = "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.1/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.std = "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.0.0/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.dip = "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.0.30/dist/"; -Dynamsoft.Core.CoreModule.engineResourcePaths.utility = "https://cdn.jsdelivr.net/npm/dynamsoft-utility@1.0.21/dist/"; +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/" +}); ``` ### Set up and start image processing @@ -398,17 +426,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 `hRouter` 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 `tempRouter` in the following code ```javascript Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"); -let hRouter = null; +let tempRouter = null; let router = null; document.getElementById('btn-scan').addEventListener('click', async () => { try { - router = await (hRouter = hRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance()); + router = await (tempRouter = tempRouter || Dynamsoft.CVR.CaptureVisionRouter.createInstance()); } catch (ex) { console.error(ex); } @@ -443,7 +471,7 @@ resultReceiver.onDecodedBarcodesReceived = (result) => { if (result.barcodeResultItems.length > 0) { resultsContainer.textContent = ''; for (let item of result.barcodeResultItems) { - // In this example, the barcode result is shown on the page beneath the video + // In this example, the barcode result is shown on the page beneath the video resultsContainer.textContent += `${item.formatString}: ${item.text}\n\n`; } } @@ -459,7 +487,7 @@ router.addResultReceiver({ onDecodedBarcodesReceived: (result) => { if (result.barcodeResultItems.length > 0) { resultsContainer.textContent = ''; for (let item of result.barcodeResultItems) { - // In this example, the barcode result is shown on the page beneath the video + // In this example, the barcode result is shown on the page beneath the video resultsContainer.textContent += `${item.formatString}: ${item.text}\n\n`; } } @@ -513,7 +541,7 @@ await router.updateSettings("ReadSingleBarcode", settings); await router.startCapturing("ReadSingleBarcode"); ``` -For a list of adjustable barcode settings, check out [SimplifiedBarcodeReaderSettings](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html){:target="_blank"}. +For a list of adjustable barcode settings, check out [SimplifiedBarcodeReaderSettings](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html). ##### Retrieve the original image @@ -623,7 +651,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.20/dynamsoft/resources/barcode-reader/templates/" +* "/dynamsoft-barcode-reader-js-10.0.21/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. @@ -666,7 +694,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.20 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.0.21 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()`. @@ -713,7 +741,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.20](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/?ver=10.0.20). +[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). ## System Requirements @@ -755,15 +783,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.20&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.0.21&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.20&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.0.21&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.20) -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.20) +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) diff --git a/dist/dbr.bundle.js b/dist/dbr.bundle.js new file mode 100644 index 0000000..43db984 --- /dev/null +++ b/dist/dbr.bundle.js @@ -0,0 +1,62 @@ +/*! +* Dynamsoft JavaScript Library +* @product Dynamsoft Barcode Reader JS Edition +* @website http://www.dynamsoft.com +* @copyright Copyright 2024, Dynamsoft Corporation +* @author Dynamsoft +* @version 10.0.21 +* @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