Generate an EAN-8 Barcode in Node.JS
--
Like with the EAN-13 barcode format, EAN-8 is used throughout European countries and is recognized internationally as a common barcode format. EAN-8 contains 8 digits and represents the compressed form of an EAN-13 barcode. The following API will all you to generate an EAN-8 barcode image in Node.JS. Be advised that EAN-8 is only recommended for use on packaging that is too small to feature an EAN-13 barcode.
Run this command to install the SDK:
npm install cloudmersive-barcodeapi-client --save
Or add this snippet to your package.json:
"dependencies": {
"cloudmersive-barcodeapi-client": "^1.1.2"
}
Then, call the function:
var CloudmersiveBarcodeapiClient = require('cloudmersive-barcodeapi-client');
var defaultClient = CloudmersiveBarcodeapiClient.ApiClient.instance;// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';var apiInstance = new CloudmersiveBarcodeapiClient.GenerateBarcodeApi();var value = "value_example"; // String | Barcode value to generate fromvar callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.generateBarcodeEAN8(value, callback);
This will return a downloadable PNG image containing your barcode. You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.