Aspose.Barcode for Node.js via Java is implemented using Node.js and Java through nodejs-java bridge.
It allows developers to quickly and easily add barcode generation and recognition functionality to their Node.js applications.
General Barcode Features
Specify different kinds of symbologies.
Barcode Code text (data to be encoded to barcode image) can be set
and its appearance related properties like font, back color, fore
color, alignment and location
(hide, above, below) etc. can also be modified.
Checksum is supported.
Barcode Caption and its font, back color, fore color, alignment and
location (hide, above, below) can be managed.
Bar height of the barcode images can be customized.
X-dimension, Y-dimension (for 2D BarCodes) are also supported.
Code128 encoding is exceptionally optimized.
Wide to Narrow Ratio can be achieved for supported symbologies.
DataMatrix barcode with X12, EDIFACT and Base 256 encoding
Able to recognize and generate a lot of different Barcode types
Barcode Recognition Features
BarcodeReader reads most common 1D, 2D barcodes anywhere at any angle from an image.
Specify an area in the image to scan the barcode
Get region information for the barcodes recognized in the image
Barcode Imaging Features
Manipulate the barcode image borders, border color, style, margins, width, etc.
Barcode image color, back color, and bar color can be modified.
Rotate barcode images to any degree.
High-quality barcode images.
Anti-Aliasing for barcode images.
Barcode image margins can be managed.
Customized resolution.
Size in inches and millimeters.
Auto Sizing of barcode images.
Create barcode images in any desired image format like BMP, JPEG, GIF, PNG
How to generate and recognize the BarCode image
const assist = require("assist.js");
const barcodeJarPath = "aspose-barcode-nodejs-20.6.jar";
let license = new assist.License();
java.classpath.push(barcodeJarPath);
let generator = new generation.BarcodeGenerator(EncodeTypes.CODE_128, "12367891011");
let file_path = "image.png";
generator.save(file_path, "PNG");
let image_data_base64 = fs.readFileSync(file_path).toString('base64');
let reader = new recognition.BarcodeReader(image_data_base64, null, DecodeType.ALL_SUPPORTED_TYPES);
if (reader.read())
{
console.log("Recognized barcode code text: " + reader.getCodeText(false) + "\n");
console.log("Recognized barcode code type: " + reader.getCodeTypeName() + "\n");
}
reader.close();
How to set quality settings and read BarCode using Node.js
let full_path = "path/to/image.png";
let reader = new recognition.BarcodeReader(full_path, null, DecodeType.ALL_SUPPORTED_TYPES);
reader.setQualitySettings(recognition.QualitySettings.getHighPerformance());
reader.getQualitySettings().setAllowMedianSmoothing(true);
reader.getQualitySettings().setMedianSmoothingWindowSize(5);
while (reader.read())
{
console.log(reader.getCodeText(false));
console.log(reader.getCodeTypeName());
}
reader.close();
How to define BarCode type and generate BarCode image
let generator = new generation.BarcodeGenerator(EncodeTypes.CODE_128, "12367891011");
let type_expected = generation.EncodeTypes.CODABAR;
generator.setBarcodeType(type_expected);
generator.save("image.png", "PNG");
let type_actual = generator.getBarcodeType();
console.log("type_expected = " + type_expected + "\n");
console.log("type_actual = " + type_actual + "\n");
Product Page | Product Documentation | Blog |API Reference | Source Code Samples | Free Support | Temporary License