Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

Initialization Control

The following static methods and properties help to set up the runtime environment for the library.

engineResourcePath

Specifies the path to find the engine(s). The property needs to be set before loadWasm. If not specified, the library will try to find the engine in the same location as the main JavaScript file (dbr.js).

static engineResourcePath: string

Code Snippet

Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.3.1/dist/";
await Dynamsoft.DBR.BarcodeReader.loadWasm();

loadWasm

Downloads and compiles the engine to get it loaded/ready for a BarcodeReader or BarcodeScanner instance to be created. You can call this API to silently set the operating environment of the library as soon as the page is loaded, avoiding unnecessary waiting time when using the library later.

If this API is not called beforehand, it will be called automatically when creating an instance of BarcodeReader or BarcodeScanner.

static loadWasm(): Promise<void>

Code Snippet

window.addEventListener('DOMContentLoaded', (event) => {
    Dynamsoft.DBR.BarcodeReader.loadWasm();
});

:+1: Tips and Tricks

isWasmLoaded

Returns whether the engine is loaded/ready.

static isWasmLoaded(): boolean

version

Returns the version of the library including the detailed version numbers of the engine and the main JavaScript code.

The engine version is only valid after loadWasm has been called.

readonly static version: string

Code Snippet

console.log(Dynamsoft.DBR.BarcodeReader.version);
// loading...(JS 8.8.3.20211011)
await Dynamsoft.DBR.BarcodeReader.loadWasm();
console.log("When loaded..." + Dynamsoft.DBR.BarcodeReader.version);
// 8.8.0.10403(JS 8.8.3.20211011)

detectEnvironment

Returns a report on the current running environments.

static detectEnvironment(): Promise<any>

Code Snippet

console.log(Dynamsoft.DBR.BarcodeReader.detectEnvironment());
// {"wasm":true, "worker":true, "getUserMedia":true, "camera":true, 
// "browser":"Chrome", "version":90, "OS":"Windows"}

onWarning

A callback which is triggered when the running environment is not ideal. In this version, it may get triggered in two scenarios:

  1. If the page is opened from the disk
  2. The page is hosted in a HTTP site without SSL

In both cases, the following warning is returned:

{
    id: 2,
    message: "Not connected via SSL (HTTPS), the SDK may not work correctly."
}

Code Snippet

Dynamsoft.DBR.BarcodeScanner.onWarning = warning => console.log(warning.message);

See Also

Warning

_bUseFullFeature

Whether to use the full engine or the compact engine. The property needs to be set before loadWasm or createInstance.

static _bUseFullFeature: boolean

Default value

true

Code Snippet

Dynamsoft.DBR.BarcodeReader._bUseFullFeature = true;
await Dynamsoft.DBR.BarcodeReader.loadWasm();

See Also

What are the differences between the compact edition and the full edition?

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 9.x
    • Version 9.2.12
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.7
    • Version 8.8.5
    • Version 8.8.3
    • Version 8.8.0
    • Version 8.6.3
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.5
    • Version 8.2.3
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.3
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +
© 2003–2023 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support