Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
Merged
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
11 changes: 10 additions & 1 deletion use-templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 style="font-size: 1.5em;">Recognize Label from a Camera</h1>
<button id="btn-open-recognizer">Open Label Recognizer</button>
<div id="div-video-container" style="margin-top: 50px; height: 700px;"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dce.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/dlr.js" data-license="Product-Keys"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/dlr.js" data-license="Product-Keys"></script>
<script>
let recognizer = null;
let promiseDlrReady;
Expand All @@ -51,6 +51,9 @@ <h1 style="font-size: 1.5em;">Recognize Label from a Camera</h1>

// callback of resources loading
Dynamsoft.DLR.LabelRecognizer.onResourcesLoadStarted = (resourcesPath)=>{console.log(resourcesPath+" is loading.")};
Dynamsoft.DLR.LabelRecognizer.onResourcesLoadProgress = (resourcesPath, progress)=>{
console.log("Loading resources progress: " + progress.loaded + "/" + progress.total);
};
Dynamsoft.DLR.LabelRecognizer.onResourcesLoaded = (resourcesPath)=>{console.log(resourcesPath+" is loaded.")};

recognizer = await Dynamsoft.DLR.LabelRecognizer.createInstance({
Expand All @@ -71,6 +74,12 @@ <h1 style="font-size: 1.5em;">Recognize Label from a Camera</h1>
alert(txt);
console.log("Unique Code Found: " + txt);
}

recognizer.onMRZRead = (txt) => {
alert(txt);
console.log("MRZ Code Found: " + txt);
}

})());

await recognizer.startScanning(true);
Expand Down