Barcode Xpress for Node.js v14.0 - Updated
Developer Guide / How To / Analyze Barcodes
In This Topic
    Analyze Barcodes
    In This Topic

    Barcode Xpress for Node.js detects all barcodes in an image and gives you complete details about them.

    Supported Barcodes for Recognition

    Barcodes supported for recognition are listed in the Supported Barcode Types.

    Once the barcode type has been determined, use the following method and parameters to recognize the barcode.

    JavaScript

    const bx = require("barcode-js");
    const filePath = "filePath/fileName.bmp";
    const params = {
        type: bx.BarcodeType.CODE39
    };
    
    const analyzeBarcodes = async (filePath, params) => {
        try {
            // Find the barcodes in the document.
            const results = await bx.analyze(filePath, params);
    
            // We have the results, process them.
            console.log(JSON.stringify(results, ["type", "value", "confidence"], 2));
        }
        catch(err) {
            console.error(`There was an error processing this image\n${err}`);
        }
    }
    
    analyzeBarcodes(filePath, params);