Barcode ScannerAdmin Scope

Note: Ensure you have installed the required package to use this SDK method.

Zia Barcode Scanner enables you to scan the most commonly used linear and 2D barcode formats and decode the encoded data. Barcode Scanner can detect formats like Codabar, EAN-13, ITF, UPC-A, QR Code, and more.

You can provide an input file of the format .jpg/.jpeg or .png. Refer to the API documentation for the request and response formats.

You can specify the barcode format using setFormat. If you enter the format as ALL, the Barcode Scanner automatically detects the format. It provides the decoded information as the response.

The zia reference used in the code snippets below is the component instance created to perform these operations. The promise returned here is resolved to a JSON object.

copy
const fs = require('fs');
const result = await zia.scanBarcode(fs.createReadStream('./barcode.png'), {format: 'code39'}); //Pass the input file and the format
console.log(result);

Example of Expected Response

A sample response that you will receive is shown below.

copy
{
  "content": "https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html"
}

Last Updated 2026-07-02 14:51:41 +0530 IST