JavaScript Barcode Scanner SDK

Client-Side Barcode Scanning in Web Applications

Need barcode reading functionality in your web application? Dynamsoft Barcode Reader SDK provides JavaScript APIs to help you easily implement that. With a few lines of JavaScript code, you can develop a robust web application to scan a linear barcode, QR Code, DataMatrix, and PDF417 online.

Read Barcodes from Mainstream Browsers on Windows

Your end users will have the flexibility on browsers: Internet Explorer version 6 and above, Edge, Firefox, and Chrome. The support for other platforms (macOS, Linux, and mobile) will be available soon.

Support mainstream browsers on Windows

Easy Integration and End-User Distribution

  • MSI installer available for IT managers to easily do batch installations to their entire network.
  • Client-side language support: JavaScript, JQuery, VBScript, HTML5, HTML.
  • Server-side programming language support: ASP.NET (C#/VB.NET), PHP, JSP, ASP, etc.
  • There is no dependency on any third-party frameworks. So any web server is supported, such as Nginx, IIS, Tomcat, Apache and more.

Technical Architecture

Dynamsoft Barcode Reader JavaScript Edition is composed of three layers: a JavaScript client, a Windows Service, and a core function DLL.

Browser JavaScript Client

  • This is the JavaScript library. It communicates with the Windows service. It accepts the operation requests from users and sends them to the service.

Windows Service

  • This module receives user operation commands from a JavaScript client. It listens on localhost and handles the interface with barcode recognition DLL and passes the response to the JavaScript layer. Users only need to install the service once.

Barcode recognition DLL

  • Barcode recognition DLL is where the barcode detection and decoding actually happens.

Integration for Reading Barcode from Video Streams and Document Scanners

There is one thing to be noted with the previous diagram. The Windows Service is not for Dynamsoft Barcode Reader's use only. In fact, it is shared by three of Dynamsoft's imaging products: Web TWAIN (starting from version 13.0), Camera SDK and Barcode Reader.


Barcode Recognition JavaScript Client

Web TWAIN JavaScript Client

Camera SDK JavaScript Client

Dynamsoft's Windows Service


Barcode Recognition


Camera SDK

Code Snippet on How to Read Barcode from Video Streams

//initiate Dynamsoft Camera SDK object
dynamsoft.dcsEnv.init('dcsVideoContainer', 'dcsImageContainer', onInitSuccess, onInitFailure);
// …
dcsObject = dynamsoft.dcsEnv.getObject(videoViewerId); //Get the Dynamsoft Camera SDK object
imageViewer = dcsObject.getImageViewer(imageViewerId); //Get a specific image viewer
// …
var dcsURL = imageViewer.image.getImagePartUrl(imageViewer.image.getIndex()); // capture one frame and save the image in an URL
// …
dbrObject.readURLAsync(dcsURL, userData, onReadSuccess, onReadFailure);