Skip to content
Merged

Dev #77

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
25 changes: 13 additions & 12 deletions 1.hello-world/1.hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<body>
Loading...
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
Expand All @@ -23,36 +23,37 @@
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

(async function() {
try {
const scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
/**
* onFrameRead is triggered after the library finishes reading a frame image.
* 'onFrameRead' is triggered after the library finishes reading a frame image.
* There can be multiple barcodes on one image.
*/
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
/**
* onUniqueRead is triggered only when a 'new' barcode is found.
* 'onUniqueRead' is triggered only when a 'new' barcode is found.
* The amount of time that the library 'remembers' a barcode is defined by
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
*/
scanner.onUniqueRead = (txt, result) => {
alert(txt);
console.log("Unique Code Found: ", result);
}
/**
* show() opens the camera and shows the video stream on the page.
* After that, the library starts to scan the frame images continuously.
*/
alert(txt);
console.log("Unique Code Found: ", result);
}
/**
* 'show()' opens the camera and shows the video stream on the page.
* After that, the library starts to scan the frame images continuously.
*/
await scanner.show();
} catch (ex) {
let errMsg;
Expand Down
7 changes: 4 additions & 3 deletions 1.hello-world/10.read-video-pwa/helloworld-pwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<body>
<h1 style="font-size: 1.5em;">Hello World for PWA</h1>
Loading...
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
Expand All @@ -25,7 +25,7 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

Expand Down Expand Up @@ -56,7 +56,8 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
scanner.onUniqueRead = (txt, result) => {
Expand Down
9 changes: 5 additions & 4 deletions 1.hello-world/11.read-video-requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
Loading...
<script src="https://cdn.jsdelivr.net/npm/[email protected]/require.js"></script>
<script>
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js'], function({
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js'], function({
BarcodeReader,
BarcodeScanner
}) {
Expand All @@ -26,19 +26,20 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";
let pScanner = null;
(async function() {
try {
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
scanner.onUniqueRead = (txt, result) => {
Expand Down
11 changes: 6 additions & 5 deletions 1.hello-world/12.read-video-es6.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1 style="font-size: 1.5em;">Hello World for ES6</h1>
Loading...
<script type="module">
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.mjs';
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.mjs';
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/
Expand All @@ -23,24 +23,25 @@ <h1 style="font-size: 1.5em;">Hello World for ES6</h1>
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

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

let pScanner = null;
(async () => {
try {
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
/*
* onFrameRead is triggered after the library finishes reading a frame.
* 'onFrameRead' is triggered after the library finishes reading a frame.
* There can be one or multiple barcodes on each frame.
*/
scanner.onFrameRead = results => {
console.log("Barcodes on one frame:");
for (let result of results) {
console.log(result.barcodeFormatString + ": " + result.barcodeText);
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
console.log(format + ": " + result.barcodeText);
}
};
/*
Expand Down
2 changes: 1 addition & 1 deletion 1.hello-world/13.read-video-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@types/node": "^16.11.45",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"dynamsoft-javascript-barcode": "9.2.13",
"dynamsoft-javascript-barcode": "9.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
4 changes: 2 additions & 2 deletions 1.hello-world/13.read-video-react-ts/src/dbr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";
9 changes: 5 additions & 4 deletions 1.hello-world/2.read-an-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
border: solid 1px gray;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
Expand All @@ -41,7 +41,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

Expand Down Expand Up @@ -95,9 +95,10 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
divResults.appendChild(createEl('p', "No Barcode Found!"));
}
for (let result of results) {
iptReadonlyLastResult.value = result.barcodeFormatString + ": " + result.barcodeText; // show last txt result
const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2;
iptReadonlyLastResult.value = format + ": " + result.barcodeText; // show last txt result
const p = document.createElement('p');
p.appendChild(createEl('span', result.barcodeFormatString + ": "));
p.appendChild(createEl('span', format + ": "));
p.appendChild(createEl('span', result.barcodeText, "sp-resultText"));
divResults.appendChild(p);
if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) {
Expand Down
2 changes: 1 addition & 1 deletion 1.hello-world/3.read-video-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "~11.2.5",
"@angular/platform-browser-dynamic": "~11.2.5",
"@angular/router": "~11.2.5",
"dynamsoft-javascript-barcode": "9.2.13",
"dynamsoft-javascript-barcode": "9.3.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand All @@ -10,4 +10,4 @@
.dbr-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
.dbr-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
@keyframes dce-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}
4 changes: 2 additions & 2 deletions 1.hello-world/3.read-video-angular/src/app/dbr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/';
BarcodeReader.engineResourcePath = 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/';
2 changes: 1 addition & 1 deletion 1.hello-world/4.read-video-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"dynamsoft-javascript-barcode": "9.2.13",
"dynamsoft-javascript-barcode": "9.3.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;}
.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;}
.dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
Expand Down
4 changes: 2 additions & 2 deletions 1.hello-world/4.read-video-react/src/dbr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
/**
* 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.
* 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/programming/javascript/user-guide/?ver=9.2.13&utm_source=github#specify-the-license or contact [email protected].
* 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 [email protected].
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.13/dist/";
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.0/dist/";
2 changes: 1 addition & 1 deletion 1.hello-world/5.read-video-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"core-js": "^3.6.5",
"dynamsoft-javascript-barcode": "9.2.13",
"dynamsoft-javascript-barcode": "9.3.0",
"vue": "^2.7.8"
},
"devDependencies": {
Expand Down
Loading