Aspose.BarCode  for JavaScript via C++

JavaScript Barcode library

Recognize or Generate 1D, 2D and Postal barcodes in any JavaScript application.

  Download Free Trial
  
 

Aspose.BarCode for JavaScript via C++ is a versatile WebAssembly-based library designed for barcode generation and recognition. Developers can easily add barcode generation and recognition functionality. JavaScript barcode API creates barcode images within various formats such as PNG, JPG, GIF, BMP. Moreover, It supports multiple imaging features like manipulating borders, color, rotating images, customizing resolution, and a lot more.

Advanced JavaScript via C++ Barcode API Features

Customize Barcode Parameters

Aspose.BarCode for JavaScript via C++ provides rich functionality to create customized barcode images. It enables generating barcodes of any color or size depending on business needs. It is possible to customize the appearance of all barcode elements, including colors of bars, background, borders, and text captions, as well as their positioning. Barcode can be generated with or without displaying input text, upper and/or lower caption, paddings, and borders. Barcode size can be set automatically depeding on the X-dimension or manually. It can be defined in various units, such as millimeters, inches, points, or pixels. If required, image proportions and resolution can be adjusted. Text font can be customized as well.

QR Code Generation

API has the capability to generate 2D barcodes of the most popular types, such as Data Matrix, Aztec Code, PDF417, etc. These types allow encoding large or non-standard input values. Here is the code for QR code generation.

Code to be executed - JavaScript


// instantiate object and set different barcode properties
var generator = new BarCodeInstance.BarcodeGenerator("QR", "");

// Set parameters
generator.Parameters.Barcode.XDimension = "2px";
generator.Parameters.Barcode.CodeTextParameters.Location = CodeLocation.Below;

// Generate image    
const img = generator.GenerateBarCodeImage();

// Display image
document.getElementById("generatedImage").src = img;

// Save image
generator.Save("generated.png");

// Cleanup resources
generator.delete()
Generation result

Optimize Barcode Reading Speed or Quality

The barcode library provides a range of powerful features for optimizing barcode reading to meet the specific needs of your business. Developers can adjust the parameters of the recognition engine to enable fast barcode scanning or improve reading precision. Depending on the quality and parameters of the source barcode images, the library allows customizing the recognition process. It includes several preset configurations of such parameters, which can be used to quickly scan high-quality barcode images or facilitate decoding damaged or degraded barcodes. Additionally, there are special settings that can improve barcode reading for different types of distortions, such as Gaussian noise, white spots, and inverted colors. With the ability to fine-tune the recognition process, the API can be tailored to provide the most efficient barcode reading for a wide range of applications and scenarios.

Barcode Recognition Live Example

The barcode reader API provides a set of features for scanning, detecting, and reading 1D, 2D, and postal barcodes. With just a few lines of code, developers can easily integrate this functionality into their applications and use it to detect and decode a wide range of commonly used barcodes. The API is designed to be user-friendly and intuitive, making it easy for developers to quickly and easily add barcode scanning capabilities to their applications.

Ready to recognize Recognizing Drop a file here or click to browse *

* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.

Code to be executed - JavaScript

    var reader = new BarCodeInstance.BarCodeReader("<file name>", "AllSupportedTypes");
reader.ReadBarCodes();

//Display found barcodes count
const count = reader.FoundCount;
console.log('Barcodes found: ' + count);

// Ensure there are barcodes found
if (count > 0) {
    // Iterate through each found barcode
    for (let i = 0; i < count; i++) {
        // Retrieve the barcode at the current index
        const res = reader.FoundBarCodes(i);
        
        // Print the code text of the barcode
        console.log(`Barcode ${i + 1}: ${res.CodeText}`);
    }
} else {
    console.log('No barcodes found.');
}

// Cleanup resources
reader.delete()
×
Barcode image

What People Are Saying

Don't just take our word for it. See what users have to say about APIs.

 
 
View Case Studies
  

Support and Learning Resources