25.2.0 • Published 4 months ago

aspose-barcode-cloud-node v25.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 months ago

Aspose.BarCode Cloud SDK for Node.js

License Node.js CI npm

  • API version: 4.0
  • Package version: 25.2.0

SDK and API Version Compatibility:

  • SDK Version 25.1 and Later: Starting from SDK version 25.1, all subsequent versions are compatible with API Version v4.0.
  • SDK Version 24.12 and Earlier: These versions are compatible with API Version v3.0.

Demo applications

Scan QRGenerate BarcodeRecognize Barcode
ScanQRGenerateRecognize
Generate Wi-Fi QREmbed BarcodeScan Barcode
Wi-FiQREmbedScan

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.

This repository contains Aspose.BarCode Cloud SDK for Node.js source code.

To use these SDKs, you will need Client Id and Client Secret which can be looked up at Aspose Cloud Dashboard (free registration in Aspose Cloud is required for this).

How to use the SDK

The complete source code is available in this repository folder. You can either directly use it in your project via source code or get nmpjs distribution (recommended).

Install Aspose.BarCode for Cloud via NPM

From the command line:

npm install aspose-barcode-cloud-node --save

Sample usage

The examples below show how your application have to generate QR code and save it on local storage:

const fs = require('fs');
const Barcode = require('aspose-barcode-cloud-node');

const config = new Barcode.Configuration(
    'Client Id from https://dashboard.aspose.cloud/applications',
    'Client Secret from https://dashboard.aspose.cloud/applications',
    null,
    process.env['TEST_CONFIGURATION_ACCESS_TOKEN']
);

async function generateBarcode(api) {
    const request = new Barcode.GenerateRequestWrapper(
        Barcode.EncodeBarcodeType.Qr, 
        'Aspose.BarCode for Cloud Sample');

    const oneBarcode = await api.generate(request);

    const fileName = 'QR.png'
    fs.writeFileSync(fileName, oneBarcode.body);

    return fileName;
}

async function scanBarcode(api, fileName) {

    const scanRequest = new Barcode.ScanMultipartRequestWrapper(fs.readFileSync(fileName));
    const result = await api.scanMultipart(scanRequest);

    return result.body.barcodes;
}

const genApi = new Barcode.GenerateApi(config);
const scanApi = new Barcode.ScanApi(config);

console.log('Generating barcode...');
generateBarcode(genApi)
    .then(fileName => {
        console.log('Barcode saved to ' + fileName);

        console.log('Trying to recognize barcode...');
        scanBarcode(scanApi, fileName)
            .then(barcodes => {
                console.log('Recognized barcodes are:');
                console.log(JSON.stringify(barcodes, null, 2));
            });
    })
    .catch(err => {
        console.error("Error: " + JSON.stringify(err, null, 2));
        process.exitCode = 1;
    });

Every method returns a chainable promise.

Licensing

All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under MIT License.

Resources

Documentation for API Endpoints

All URIs are relative to https://api.aspose.cloud/v4.0/

ClassMethodHTTP requestDescription
GenerateApigenerateGET /barcode/generate/{barcodeType}Generate barcode using GET request with parameters in route and query string.
GenerateApigenerateBodyPOST /barcode/generate-bodyGenerate barcode using POST request with parameters in body in json or xml format.
GenerateApigenerateMultipartPOST /barcode/generate-multipartGenerate barcode using POST request with parameters in multipart form.
RecognizeApirecognizeGET /barcode/recognizeRecognize barcode from file on server using GET requests with parameters in route and query string.
RecognizeApirecognizeBase64POST /barcode/recognize-bodyRecognize barcode from file in request body using POST requests with parameters in body in json or xml format.
RecognizeApirecognizeMultipartPOST /barcode/recognize-multipartRecognize barcode from file in request body using POST requests with parameters in multipart form.
ScanApiscanGET /barcode/scanScan barcode from file on server using GET requests with parameter in query string.
ScanApiscanBase64POST /barcode/scan-bodyScan barcode from file in request body using POST requests with parameter in body in json or xml format.
ScanApiscanMultipartPOST /barcode/scan-multipartScan barcode from file in request body using POST requests with parameter in multipart form.
25.2.0

4 months ago

25.1.0

5 months ago

24.12.0

6 months ago

24.11.0

7 months ago

24.10.0

8 months ago

24.9.0

9 months ago

24.8.0

10 months ago

24.7.0

11 months ago

24.6.0

12 months ago

24.5.0

1 year ago

24.4.0

1 year ago

24.3.0

1 year ago

24.2.0

1 year ago

24.1.0

1 year ago

23.12.0

1 year ago

23.11.0

2 years ago

23.8.0

2 years ago

23.7.0

2 years ago

23.9.0

2 years ago

23.10.0

2 years ago

23.6.0

2 years ago

23.4.0

2 years ago

23.5.0

2 years ago

23.3.0

2 years ago

23.2.0

2 years ago

22.12.0

3 years ago

23.1.0

2 years ago

22.11.0

3 years ago

22.10.0

3 years ago

22.9.0

3 years ago

22.8.0

3 years ago

22.7.0

3 years ago

22.3.0

3 years ago

22.1.0

3 years ago

21.12.0

4 years ago

21.10.0

4 years ago

21.9.0

4 years ago

21.7.0

4 years ago

21.6.0

4 years ago

21.3.0

4 years ago

21.2.0

4 years ago

20.12.0

4 years ago

20.11.1

5 years ago

20.11.0

5 years ago

20.10.0

5 years ago

20.8.0

5 years ago

20.6.0

5 years ago

20.5.0

5 years ago

18.6.0

7 years ago