Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Dev #5

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ __pycache__
==*
package-lock.json
yarn.lock
sonar-project.properties
.npmrc
.git
log.txt
/*.zip
/*.py
/*.exe
Expand All @@ -48,6 +51,8 @@ yarn.lock
/public
/original_model_files
/dce
/.scannerwork
/js_scanreport
/README.html

!bower.json
Expand Down
2 changes: 1 addition & 1 deletion Api Reference.url
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[InternetShortcut]
URL=https://www.dynamsoft.com/label-recognition/programming/javascript/?ver=2.2.11
URL=https://www.dynamsoft.com/label-recognition/programming/javascript/?ver=latest
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2003–2022 Dynamsoft. All Rights Reserved.
Copyright © 2003–2023 Dynamsoft. All Rights Reserved.

The use of this software is governed by the Dynamsoft Terms and Conditions.
URL=https://www.dynamsoft.com/label-recognition/license-agreement/
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!--The original doc is hosted here => https://github.com/dynamsoft-docs/label-recognition-docs/blob/master/programming/javascript/user-guide.md -->

# Dynamsoft Label Recognizer for Your Website

Add the capability of reading passport MRZs, ID cards, VIN numbers, and various other fixed text fields in your web application with just a few lines of code.
Expand Down Expand Up @@ -44,8 +43,8 @@ The complete code of the "MRZ Reading" example is shown below

<head>
<title>MRZ Reading</title>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.11/dist/dlr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.0.1/dist/dce.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.30/dist/dlr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.2.0/dist/dce.js"></script>
</head>

<body>
Expand Down Expand Up @@ -100,7 +99,7 @@ The complete code of the "MRZ Reading" example is shown below

<p align="center" style="text-align:center; white-space: normal; ">
<a target="_blank" href="https://jsfiddle.net/DynamsoftTeam/kc35htxd/" title="Run via JSFiddle">
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/jsfiddle.svg" alt="Run via JSFiddle" width="20" height="20" style="width:20px;height:20px;">
<img src="https://cdn.jsdelivr.net/npm/simple-icons@3.2.0/icons/jsfiddle.svg" alt="Run via JSFiddle" width="20" height="20" style="width:20px;height:20px;">
</a>
</p>

Expand All @@ -125,12 +124,13 @@ The complete code of the "MRZ Reading" example is shown below
>| `MRZ` | For MRZ (machine-readable zone) recognition. |
>| `passportMRZ` | For passport MRZ recognition. |
>| `visaMRZ` | For Visa (Country not Credit Card) MRZ recognition. |
>| `idcardMRZ` | For ID card MRZ recognition. |
>| `VIN` | For VIN (vehicle identification number) recognition. |
>| `VIN_NA` | For North American VIN (vehicle identification number) recognition. |
>
> When recognizing from video input, add the prefix "video-" for a slightly different template optimized for continuous frame recognition. For example, use `video-passportMRZ` to read the MRZ on passports with a camera.

* `onMRZRead`: This event is only used with one of the templates "MRZ", "passportMRZ" and "visaMRZ" (similarly, "onVINRead" is only used with either "VIN" or "VIN_NA"). It is triggered each time the SDK has identified and finished the recognition of a MRZ zone. The `results` object contains 2 or 3 lines of text results corresponding to the 2 or 3 lines in the MRZ. In this example, we simply print the results to the browser console.
* `onMRZRead`: This event is only used with one of the templates "MRZ", "passportMRZ", "visaMRZ" and "idcardMRZ" (similarly, "onVINRead" is only used with either "VIN" or "VIN_NA"). It is triggered each time the SDK has identified and finished the recognition of a MRZ zone. The `results` object contains 2 or 3 lines of text results corresponding to the 2 or 3 lines in the MRZ. In this example, we simply print the results to the browser console.

> The events `onImageRead` and `onUniqueRead` are used in the code but they are not required. You can compare the results returned in the 3 events and see what the differences are.

Expand Down Expand Up @@ -158,7 +158,7 @@ If the test doesn't go as expected, you can [contact us](https://www.dynamsoft.c

### Check out the official sample for MRZ reading

You can also try the official sample for MRZ reading ([test in Github](https://dynamsoft.github.io/label-recognizer-javascript-samples/2.use-case/2.mrz-read-and-parse/) or [check the code](https://github.com/Dynamsoft/label-recognizer-javascript-samples/tree/main/2.use-case/2.mrz-read-and-parse)). This sample also demonstrates how to parse the MRZ text into meaningful fields.
You can also try the official sample for MRZ reading ([test in Github](https://dynamsoft.github.io/label-recognizer-javascript-samples/use-case/mrz-read-and-parse/) or [check the code](https://github.com/Dynamsoft/label-recognizer-javascript-samples/tree/main/use-case/mrz-read-and-parse)). This sample also demonstrates how to parse the MRZ text into meaningful fields.

## Building your own page

Expand All @@ -173,15 +173,15 @@ The simplest way to include the SDK is to use either the [jsDelivr](https://jsde
* jsDelivr

```html
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.11/dist/dlr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.0.1/dist/dce.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.30/dist/dlr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.2.0/dist/dce.js"></script>
```

* UNPKG

```html
<script src="https://unpkg.com/dynamsoft-label-recognizer@2.2.11/dist/dlr.js"></script>
<script src="https://unpkg.com/dynamsoft-camera-enhancer@3.0.1/dist/dce.js"></script>
<script src="https://unpkg.com/dynamsoft-label-recognizer@2.2.30/dist/dlr.js"></script>
<script src="https://unpkg.com/dynamsoft-camera-enhancer@3.2.0/dist/dce.js"></script>
```

#### Host the SDK yourself
Expand All @@ -193,22 +193,22 @@ To download the SDK:
* yarn

```cmd
yarn add dynamsoft-label-recognizer@2.2.11
yarn add dynamsoft-camera-enhancer@3.0.1
yarn add dynamsoft-label-recognizer@2.2.30
yarn add dynamsoft-camera-enhancer@3.2.0
```

* npm

```cmd
npm install dynamsoft-label-recognizer@2.2.11
npm install dynamsoft-camera-enhancer@3.0.1
npm install dynamsoft-label-recognizer@2.2.30
npm install dynamsoft-camera-enhancer@3.2.0
```

Depending on how you downloaded the SDK and where you put it, you can typically include it like this:

```html
<script src="/dlr-js-2.2.11/dist/dlr.js"></script>
<script src="/dlr-js-2.2.11/dce/dist/dce.js"></script>
<script src="/dynamsoft-label-recognizer-js-2.2.30/dist/dlr.js"></script>
<script src="/dynamsoft-label-recognizer-js-2.2.30/dce/dist/dce.js"></script>
```

or
Expand Down Expand Up @@ -245,8 +245,8 @@ If the engine files (\*.worker.js, \*.wasm.js and \*.wasm, etc.) are not in the

```javascript
// The following code uses the jsDelivr CDN, feel free to change it to your own location of these files.
Dynamsoft.DLR.LabelRecognizer.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.11/dist/";
Dynamsoft.DCE.CameraEnhancer.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.0.1/dist/";
Dynamsoft.DLR.LabelRecognizer.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.30/dist/";
Dynamsoft.DCE.CameraEnhancer.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@3.2.0/dist/";
```

**This configuration is usually required with frameworks like Angular or React where dlr.js is compiled into another file.**
Expand Down Expand Up @@ -301,7 +301,7 @@ await recognizer.setImageSource(cameraEnhancer, options);

#### Change the camera settings if necessary

In some cases, a different camera might be required instead of the default one. Also, a different resolution might work better. To change the camera or the resolution, we use the `CameraEnhancer` object. Learn more [here](https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/api-reference/camera-control.html?ver=3.0.1&utm_source=github&product=dlr&package=js).
In some cases, a different camera might be required instead of the default one. Also, a different resolution might work better. To change the camera or the resolution, we use the `CameraEnhancer` object. Learn more [here](https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/api-reference/camera-control.html?ver=3.2.0&utm_source=github&product=dlr&package=js).

```javascript
// The following lines set which camera and what resolution to use.
Expand Down Expand Up @@ -450,7 +450,7 @@ await recognizer.startScanning(true);
## API Documentation

You can check out the detailed documentation about the APIs of the SDK at
[https://www.dynamsoft.com/label-recognition/docs/programming/javascript/api-reference/?ver=2.2.11&utm_source=github&product=dlr&package=js](https://www.dynamsoft.com/label-recognition/docs/programming/javascript/api-reference/?ver=2.2.11&utm_source=github&product=dlr&package=js).
[https://www.dynamsoft.com/label-recognition/docs/programming/javascript/api-reference/?ver=2.2.30&utm_source=github&product=dlr&package=js](https://www.dynamsoft.com/label-recognition/docs/programming/javascript/api-reference/?ver=2.2.30&utm_source=github&product=dlr&package=js).

## System Requirements

Expand All @@ -471,7 +471,7 @@ DLR requires the following features to work:

* `MediaDevices`/`getUserMedia`

This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=9.2.12&utm_source=github#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera.
This API is only required for in-browser video streaming.

* `getSettings`

Expand All @@ -496,7 +496,7 @@ Apart from the browsers, the operating systems may impose some limitations of th

## Release Notes

Learn about what are included in each release at [https://www.dynamsoft.com/label-recognition/docs/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/label-recognition/docs/programming/javascript/release-notes/?ver=latest).
Learn about what are included in each release at [https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/release-notes/?ver=latest](https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/release-notes/?ver=latest).

## Next Steps

Expand Down
Binary file modified dist/Number/Number.data
Binary file not shown.
11 changes: 0 additions & 11 deletions dist/dlr-2.2.11.browser.worker.js

This file was deleted.

Binary file removed dist/dlr-2.2.11.wasm
Binary file not shown.
11 changes: 11 additions & 0 deletions dist/dlr-2.2.30.browser.worker.js

Large diffs are not rendered by default.

Binary file added dist/dlr-2.2.30.wasm
Binary file not shown.
File renamed without changes.
6 changes: 3 additions & 3 deletions dist/dlr.esm.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/dlr.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/dlr.mjs

Large diffs are not rendered by default.

Loading