Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynamsoft-javascript-barcode

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamsoft-javascript-barcode

Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR

  • 6.4.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Dynamsoft JavaScript Barcode SDK

A WebAssembly barcode library for building JavaScript barcode detection apps.

Overview

Dynamsoft JavaScript Barcode Reader is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR Code, DataMatrix, PDF417, and Aztec Code.

Installation

npm install dynamsoft-javascript-barcode

Barcode Types Support

  • 1D barcode: Code 39, Code 93, Code 128, Codabar, EAN-8, EAN-13, UPC-A, UPC-E, Interleaved 2 of 5 (ITF), Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5), ITF-14.
  • 2D barcode: QRCode, DataMatrix, PDF417, and Aztec Code.

Usage

Node.js server-side:

const fs = require('fs');
var source = fs.readFileSync('test.jpg');
var typedArray = new Uint8Array(source);
const Module = require('dynamsoft-javascript-barcode');
Module.onRuntimeInitialized = function() {
    let dbr = new Module.BarcodeReaderWasm("<License>");
    let results = dbr.DecodeFileInMemory(typedArray, "");
    let json = JSON.parse(results);
    let barcodeResults = json['textResult'];
    let txts = [];
    for (let i = 0; i < barcodeResults.length; ++i) {
        txts.push(Buffer.from(barcodeResults[i].BarcodeText, 'base64').toString('ascii'));
      }
    console.log(txts.join(", "));
};

Web client-side:

var reader;
Module.onRuntimeInitialized = function () {
  document.getElementById('anim-loading').style.display = 'none';
  buttonFile.disabled = false;
  buttonVideo.disabled = false;
  reader = new Module.BarcodeReaderWasm("<License>");
};

if (reader) {
    try {
        // results = reader.DecodeBuffer(idd.buffer, imageWidth, imageHeight, imageWidth * 4, 7, "");
        let results = reader.DecodeFileInMemory(arrayBuffer, "");
        let json = JSON.parse(results);
        let barcodeResults = json['textResult'];
        let txts = [];
        for (let i = 0; i < barcodeResults.length; ++i) {
          txts.push(b64DecodeUnicode(barcodeResults[i].BarcodeText));
        }
        barcode_result.textContent = txts.join(", ");
      } catch (e) {
        console.log(e);
      }
}

The Lite Version Only for Web Development

https://demo.dynamsoft.com/dbr_wasm/js/dbr-6.4.1.1.min.js

API Reference

https://github.com/dynamsoft-dbr/javascript-barcode/blob/master/documents/api-original.md

Sample Code

https://github.com/dynamsoft-dbr/javascript-barcode

Online Demo

https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html

Web barcode reader

License

Apply for a trial license at https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx.

Contact Us

https://www.dynamsoft.com/Company/Contact.aspx

Keywords

FAQs

Package last updated on 20 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc