Giter Club home page Giter Club logo

aspose-barcode-cloud / aspose-barcode-cloud-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 10.0 2.0 26.18 MB

Repository contains Java Library for communicating with the Aspose.BarCode Cloud API

License: MIT License

Makefile 0.10% Java 99.12% Shell 0.35% Dockerfile 0.07% Python 0.37%
barcode barcode-generator barcode-cloud barcode-recognizer aspose-cloud barcode-scanner barcode-reader barcodes barcode-scanning barcode-detection barcodescanner barcode-images qrcode qrcode-generator qrcode-scanner qr-code qr qrcode-reader qr-codes qr-generator

aspose-barcode-cloud-java's Introduction

Aspose.BarCode Cloud SDK for Java

License Java CI with Maven Maven metadata URL

  • API version: 3.0
  • SDK version: 24.7.0

Demo applications

Scan QR Generate Barcode Recognize Barcode
ScanQR Generate Recognize
Generate Wi-Fi QR Embed Barcode Scan Barcode
Wi-FiQR Embed Scan

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 Java source code. This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Java applications quickly and easily.

Requirements

Building the API client library requires:

  1. Java 8 (JDK 1.8)
  2. Maven

Prerequisites

To use Aspose.BarCode Cloud SDK for Java you need to register an account with Aspose Cloud and lookup/create Client Id and Client Secret at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.

Installation

Install Aspose.BarCode-Cloud from Maven

Add Aspose Cloud repository to your application pom.xml

<repository>
    <id>aspose-cloud</id>
    <name>Aspose Cloud Repository</name>
    <url>https://releases.aspose.cloud/java/repo/</url>
</repository>

Install from source

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.aspose</groupId>
  <artifactId>aspose-barcode-cloud</artifactId>
  <version>24.7.0</version>
  <scope>compile</scope>
</dependency>

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/aspose-barcode-cloud-24.7.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

package com.aspose.barcode.cloud.examples;

import com.aspose.barcode.cloud.ApiClient;
import com.aspose.barcode.cloud.ApiException;
import com.aspose.barcode.cloud.api.BarcodeApi;
import com.aspose.barcode.cloud.model.BarcodeResponseList;
import com.aspose.barcode.cloud.model.DecodeBarcodeType;
import com.aspose.barcode.cloud.model.EncodeBarcodeType;
import com.aspose.barcode.cloud.requests.GetBarcodeGenerateRequest;
import com.aspose.barcode.cloud.requests.ScanBarcodeRequest;

import java.io.File;
import java.util.Collections;

public class Example {
    public static void main(String[] args) {
        ApiClient client =
                new ApiClient(
                        "Client Id from https://dashboard.aspose.cloud/applications",
                        "Client Secret from https://dashboard.aspose.cloud/applications");
        client.setReadTimeout(5 * 60 * 1000);

        BarcodeApi api = new BarcodeApi(client);

        try {
            System.out.println("Generating barcode...");
            File barcodeImage = generateBarcode(api);
            System.out.println("Barcode image saved to file " + barcodeImage.getAbsolutePath());

            System.out.println("Recognizing barcode on image...");
            BarcodeResponseList recognized = scanBarcode(api, barcodeImage);
            System.out.print("Barcode on image:");
            System.out.println(recognized.toString());
        } catch (ApiException e) {
            System.err.println("Error");
            e.printStackTrace();
        }
    }

    private static File generateBarcode(BarcodeApi api) throws ApiException {
        String type = EncodeBarcodeType.QR.toString();
        String text = "Aspose.BarCode for Cloud Sample";
        GetBarcodeGenerateRequest request = new GetBarcodeGenerateRequest(type, text);
        request.textLocation = "None";

        return api.getBarcodeGenerate(request);
    }

    private static BarcodeResponseList scanBarcode(BarcodeApi api, File barcodeImage)
            throws ApiException {
        ScanBarcodeRequest request = new ScanBarcodeRequest(barcodeImage);
        request.decodeTypes = Collections.singletonList(DecodeBarcodeType.QR);

        return api.scanBarcode(request);
    }
}

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/v3.0

Class Method HTTP request Description
BarcodeApi getBarcodeGenerate GET /barcode/generate Generate barcode.
BarcodeApi getBarcodeRecognize GET /barcode/{name}/recognize Recognize barcode from a file on server.
BarcodeApi postBarcodeRecognizeFromUrlOrContent POST /barcode/recognize Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type &quot;application/octet-stream&quot;. An image can also be passed as a form field.
BarcodeApi postGenerateMultiple POST /barcode/generateMultiple Generate multiple barcodes and return in response stream
BarcodeApi putBarcodeGenerateFile PUT /barcode/{name}/generate Generate barcode and save on server (from query params or from file with json or xml content)
BarcodeApi putBarcodeRecognizeFromBody PUT /barcode/{name}/recognize Recognition of a barcode from file on server with parameters in body.
BarcodeApi putGenerateMultiple PUT /barcode/{name}/generateMultiple Generate image with multiple barcodes and put new file on server
BarcodeApi scanBarcode POST /barcode/scan Quickly scan a barcode from an image.
FileApi copyFile PUT /barcode/storage/file/copy/{srcPath} Copy file
FileApi deleteFile DELETE /barcode/storage/file/{path} Delete file
FileApi downloadFile GET /barcode/storage/file/{path} Download file
FileApi moveFile PUT /barcode/storage/file/move/{srcPath} Move file
FileApi uploadFile PUT /barcode/storage/file/{path} Upload file
FolderApi copyFolder PUT /barcode/storage/folder/copy/{srcPath} Copy folder
FolderApi createFolder PUT /barcode/storage/folder/{path} Create the folder
FolderApi deleteFolder DELETE /barcode/storage/folder/{path} Delete folder
FolderApi getFilesList GET /barcode/storage/folder/{path} Get all files and folders within a folder
FolderApi moveFolder PUT /barcode/storage/folder/move/{srcPath} Move folder
StorageApi getDiscUsage GET /barcode/storage/disc Get disc usage
StorageApi getFileVersions GET /barcode/storage/version/{path} Get file versions
StorageApi objectExists GET /barcode/storage/exist/{path} Check if file or folder exists
StorageApi storageExists GET /barcode/storage/{storageName}/exist Check if storage exists

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

JWT

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

aspose-barcode-cloud-java's People

Contributors

denis-averin avatar dependabot[bot] avatar ivankamkin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspose-barcode-cloud-java's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.