Skip to content

Commit afef08f

Browse files
author
Cube
authored
Merge pull request #77 from Dynamsoft/_dev
Dev
2 parents 9480c31 + 173e949 commit afef08f

46 files changed

Lines changed: 216 additions & 92 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1.hello-world/1.hello-world.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<body>
1414
Loading...
15-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
15+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
1616
<script>
1717
/** LICENSE ALERT - README
1818
* To use the library, you need to first specify a license key using the API "license" as shown below.
@@ -23,36 +23,37 @@
2323
/**
2424
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
2525
* 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.
26-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
26+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2727
* LICENSE ALERT - THE END
2828
*/
2929

3030
(async function() {
3131
try {
3232
const scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
3333
/**
34-
* onFrameRead is triggered after the library finishes reading a frame image.
34+
* 'onFrameRead' is triggered after the library finishes reading a frame image.
3535
* There can be multiple barcodes on one image.
3636
*/
3737
scanner.onFrameRead = results => {
3838
console.log("Barcodes on one frame:");
3939
for (let result of results) {
40-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
40+
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
41+
console.log(format + ": " + result.barcodeText);
4142
}
4243
};
4344
/**
44-
* onUniqueRead is triggered only when a 'new' barcode is found.
45+
* 'onUniqueRead' is triggered only when a 'new' barcode is found.
4546
* The amount of time that the library 'remembers' a barcode is defined by
4647
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
4748
*/
4849
scanner.onUniqueRead = (txt, result) => {
49-
alert(txt);
50-
console.log("Unique Code Found: ", result);
51-
}
52-
/**
53-
* show() opens the camera and shows the video stream on the page.
54-
* After that, the library starts to scan the frame images continuously.
55-
*/
50+
alert(txt);
51+
console.log("Unique Code Found: ", result);
52+
}
53+
/**
54+
* 'show()' opens the camera and shows the video stream on the page.
55+
* After that, the library starts to scan the frame images continuously.
56+
*/
5657
await scanner.show();
5758
} catch (ex) {
5859
let errMsg;

1.hello-world/10.read-video-pwa/helloworld-pwa.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515
<h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1616
Loading...
17-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
17+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
1818
<script>
1919
/** LICENSE ALERT - README
2020
* To use the library, you need to first specify a license key using the API "license" as shown below.
@@ -25,7 +25,7 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
2525
/**
2626
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
2727
* 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.
28-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
28+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2929
* LICENSE ALERT - THE END
3030
*/
3131

@@ -56,7 +56,8 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
5656
scanner.onFrameRead = results => {
5757
console.log("Barcodes on one frame:");
5858
for (let result of results) {
59-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
59+
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
60+
console.log(format + ": " + result.barcodeText);
6061
}
6162
};
6263
scanner.onUniqueRead = (txt, result) => {

1.hello-world/11.read-video-requirejs.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
1313
Loading...
1414
<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.js"></script>
1515
<script>
16-
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js'], function({
16+
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js'], function({
1717
BarcodeReader,
1818
BarcodeScanner
1919
}) {
@@ -26,19 +26,20 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
2626
/**
2727
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
2828
* 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.
29-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
29+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
3030
* LICENSE ALERT - THE END
3131
*/
3232

33-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
33+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";
3434
let pScanner = null;
3535
(async function() {
3636
try {
3737
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3838
scanner.onFrameRead = results => {
3939
console.log("Barcodes on one frame:");
4040
for (let result of results) {
41-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
41+
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
42+
console.log(format + ": " + result.barcodeText);
4243
}
4344
};
4445
scanner.onUniqueRead = (txt, result) => {

1.hello-world/12.read-video-es6.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<h1 style="font-size: 1.5em;">Hello World for ES6</h1>
1414
Loading...
1515
<script type="module">
16-
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.mjs';
16+
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.mjs';
1717
/** LICENSE ALERT - README
1818
* To use the library, you need to first specify a license key using the API "license" as shown below.
1919
*/
@@ -23,24 +23,25 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
2323
/**
2424
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
2525
* 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.
26-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
26+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
2727
* LICENSE ALERT - THE END
2828
*/
2929

30-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
30+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";
3131

3232
let pScanner = null;
3333
(async () => {
3434
try {
3535
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
3636
/*
37-
* onFrameRead is triggered after the library finishes reading a frame.
37+
* 'onFrameRead' is triggered after the library finishes reading a frame.
3838
* There can be one or multiple barcodes on each frame.
3939
*/
4040
scanner.onFrameRead = results => {
4141
console.log("Barcodes on one frame:");
4242
for (let result of results) {
43-
console.log(result.barcodeFormatString + ": " + result.barcodeText);
43+
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
44+
console.log(format + ": " + result.barcodeText);
4445
}
4546
};
4647
/*

1.hello-world/13.read-video-react-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@types/node": "^16.11.45",
1212
"@types/react": "^18.0.15",
1313
"@types/react-dom": "^18.0.6",
14-
"dynamsoft-javascript-barcode": "9.2.13",
14+
"dynamsoft-javascript-barcode": "9.3.0",
1515
"react": "^18.2.0",
1616
"react-dom": "^18.2.0",
1717
"react-scripts": "5.0.1",

1.hello-world/13.read-video-react-ts/src/components/VideoDecode/VideoDecode.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
2-
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
1+
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
2+
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
33
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
44
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
55
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}

1.hello-world/13.read-video-react-ts/src/dbr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ BarcodeReader.license = 'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAwLWRicl9qc19zYW1wbGV
99
/**
1010
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
1111
* 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.
12-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
12+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
1313
* LICENSE ALERT - THE END
1414
*/
1515

16-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
16+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";

1.hello-world/2.read-an-image.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
3030
border: solid 1px gray;
3131
}
3232
</style>
33-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
33+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
3434
<script>
3535
/** LICENSE ALERT - README
3636
* To use the library, you need to first specify a license key using the API "license" as shown below.
@@ -41,7 +41,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
4141
/**
4242
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
4343
* 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.
44-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact support@dynamsoft.com.
44+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.3.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
4545
* LICENSE ALERT - THE END
4646
*/
4747

@@ -95,9 +95,10 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
9595
divResults.appendChild(createEl('p', "No Barcode Found!"));
9696
}
9797
for (let result of results) {
98-
iptReadonlyLastResult.value = result.barcodeFormatString + ": " + result.barcodeText; // show last txt result
98+
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
99+
iptReadonlyLastResult.value = format + ": " + result.barcodeText; // show last txt result
99100
const p = document.createElement('p');
100-
p.appendChild(createEl('span', result.barcodeFormatString + ": "));
101+
p.appendChild(createEl('span', format + ": "));
101102
p.appendChild(createEl('span', result.barcodeText, "sp-resultText"));
102103
divResults.appendChild(p);
103104
if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) {

1.hello-world/3.read-video-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@angular/platform-browser": "~11.2.5",
2020
"@angular/platform-browser-dynamic": "~11.2.5",
2121
"@angular/router": "~11.2.5",
22-
"dynamsoft-javascript-barcode": "9.2.13",
22+
"dynamsoft-javascript-barcode": "9.3.0",
2323
"rxjs": "~6.6.0",
2424
"tslib": "^2.0.0",
2525
"zone.js": "~0.11.3"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
2-
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
1+
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
2+
.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
33
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
44
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
55
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
@@ -10,4 +10,4 @@
1010
.dbr-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
1111
.dbr-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
1212
@keyframes dce-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
13-
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}
13+
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}

0 commit comments

Comments
 (0)