aspose-barcode-cloud-node
Advanced tools
Comparing version 21.2.0 to 21.3.0
{ | ||
"name": "aspose-barcode-cloud-node", | ||
"version": "21.2.0", | ||
"version": "21.3.0", | ||
"description": "Aspose.BarCode Cloud SDK for Node.js", | ||
@@ -42,6 +42,6 @@ "homepage": "https://products.aspose.cloud/barcode/nodejs", | ||
"@types/uuid": "^8.3.0", | ||
"npm-check-updates": "^10.2.5", | ||
"npm-check-updates": "^11.2.0", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.0.3", | ||
"typescript": "^4.1.3", | ||
"tslib": "^2.1.0", | ||
"typescript": "^4.2.3", | ||
"uuid": "^8.3.2" | ||
@@ -48,0 +48,0 @@ }, |
# Aspose.BarCode Cloud SDK for Node.js | ||
+ API version: 3.0 | ||
+ Package version: 21.2.0 | ||
+ Package version: 21.3.0 | ||
@@ -37,14 +37,42 @@ Aspose.BarCode for Cloud is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements. | ||
async function generate(api) { | ||
const oneBarcode = await api.getBarcodeGenerate( | ||
async function generateBarcode(api) { | ||
const request = new Barcode.GetBarcodeGenerateRequest( | ||
Barcode.EncodeBarcodeType.Pdf417, | ||
'Aspose.BarCode for Cloud Sample' | ||
); | ||
'Aspose.BarCode for Cloud Sample'); | ||
const oneBarcode = await api.getBarcodeGenerate(request); | ||
fs.writeFileSync('out.png', oneBarcode.body); | ||
console.log('Saved to out.png'); | ||
const fileName = 'Pdf417.png' | ||
fs.writeFileSync(fileName, oneBarcode.body); | ||
return fileName; | ||
} | ||
async function recognizeBarcode(api, fileName) { | ||
const request = new Barcode.PostBarcodeRecognizeFromUrlOrContentRequest(); | ||
request.image = fs.readFileSync(fileName); | ||
request.preset = Barcode.PresetType.HighPerformance; | ||
const result = await api.postBarcodeRecognizeFromUrlOrContent(request); | ||
return result.body.barcodes; | ||
} | ||
const api = new Barcode.BarcodeApi(config); | ||
generate(api).catch(err => console.error(err)); | ||
console.log('Generating barcode...'); | ||
generateBarcode(api) | ||
.then(fileName => { | ||
console.log('Barcode saved to ' + fileName); | ||
console.log('Trying to recognize barcode...'); | ||
recognizeBarcode(api, fileName) | ||
.then(barcodes => { | ||
console.log('Recognized barcodes are:'); | ||
console.log(JSON.stringify(barcodes, null, 2)); | ||
}); | ||
}) | ||
.catch(err => { | ||
console.error(JSON.stringify(err, null, 2)); | ||
process.exitCode = 1; | ||
}); | ||
``` | ||
@@ -51,0 +79,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1406307
16
10989
121