<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-barcode-cloud</artifactId>
    <version>23.12.0</version>
</dependency>
copied!  
compile(group: 'com.aspose', name: 'aspose-barcode-cloud', version: '23.12.0')
copied!  
<dependency org="com.aspose" name="aspose-barcode-cloud" rev="23.12.0">
    <artifact name="aspose-barcode-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.aspose" % "aspose-barcode-cloud" % "23.12.0"
copied!  

Java Cloud API to Create & Recognize Barcodes

banner

Product Page | Docs | Demos | Swagger UI | Examples | Blog | Search | Free Support | Free Trial

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.

BarCode Cloud Processing Features

  • Generate, scan and customize 1D (linear), 2D and postal barcodes.
  • Generate and recognize barcodes with the checksum option.
  • Fetch barcode as an image stream or save the barcode to the local disk.
  • Configure barcode height, width, angle quality, margin & resolution.
  • Configure barcode to be auto-sized or set X & Y dimensions.
  • Generate a new barcode with a specified code text location.
  • Apply bar height and barcode image format.
  • Rotate the barcode image at a certain angle & generate multiple barcodes.
  • Scan image to recognize barcode from a specific region of that image.
  • Recognize the specified number of barcodes.
  • Apply image processing algorithms to read barcodes.

Barcode Cloud Storage Features

  • Upload, download, copy, move and delete files, including versions handling (if you are using Cloud storage that supports this feature - true by default).
  • Create, copy, move and delete folders.
  • Copy and move files and folders accross separate storages in scope of a single operation.
  • Check if certain file, folder or storage exists.

Read & Write BarCode Formats

JPEG, TIFF, PNG, BMP, GIF, EXIF

Save BarCode As

EMF, SVG

Supported Barcode Symbologies

Linear barcode symbologies: EAN13, EAN8, UPCA, UPCE, Interleaved2of5, Standard2of5, MSI, Code11, Codabar, EAN14(SCC14), SSCC18, ITF14, Matrix 2 of 5, PZN, Code128, Code39 Extended, Code39 Standard, Code93 Extended, Code16K, Code93 Standard, IATA 2 of 5, OPC, GS1Code128, ISBN, ISMN, ISSN, ITF6, VIN, Pharmacode, DatabarOmniDirectional, DatabarTruncated, DatabarLimited, DatabarExpanded, DatabarStackedOmniDirectional, DatabarExpandedStacked, DatabarStacked, PatchCode, Supplement (Decode only).

2D barcode symbologies: PDF417, MacroPDF417, MicroPDF417, CompactPDF417 (Decode only), DataMatrix, Aztec, QR, MicroQR, DotCode, MaxiCode, Italian Post 25, GS1DataMatrix, Code16K.

Postal barcode symbologies: Postnet, Planet, USPS OneCode, Australia Post, Deutsche Post Identcode, Deutsche Post Leticode, RM4SCC, SingaporePost, AustralianPosteParcel, SwissPostParcel, UpcaGs1DatabarCoupon.

Requirements

Building the API client library requires:

  1. Java 1.7+
  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 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>22.3.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-22.3.0.jar
  • target/lib/*.jar

Get Started

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

import com.aspose.barcode.cloud.api.BarcodeApi;
import com.aspose.barcode.cloud.model.BarcodeResponseList;
import com.aspose.barcode.cloud.model.EncodeBarcodeType;
import com.aspose.barcode.cloud.model.PresetType;
import com.aspose.barcode.cloud.requests.GetBarcodeGenerateRequest;
import com.aspose.barcode.cloud.requests.PostBarcodeRecognizeFromUrlOrContentRequest;

import java.io.File;

public class BarcodeApiExample {
    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 = recognizeBarcode(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.PDF417.toString();
        String text = "Aspose.BarCode for Cloud Sample";
        GetBarcodeGenerateRequest request = new GetBarcodeGenerateRequest(type, text);

        return api.getBarcodeGenerate(request);
    }

    private static BarcodeResponseList recognizeBarcode(BarcodeApi api, File barcodeImage) throws ApiException {
        PostBarcodeRecognizeFromUrlOrContentRequest recognizeRequest = new PostBarcodeRecognizeFromUrlOrContentRequest();
        recognizeRequest.image = barcodeImage;
        recognizeRequest.preset = PresetType.HIGHPERFORMANCE.toString();

        return api.postBarcodeRecognizeFromUrlOrContent(recognizeRequest);
    }
}

Licensing

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

Authorization & Authentication

Authentication schemes defined for the API is as follows:

JWT

Recommendation

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

Product Page | Docs | Demos | Swagger UI | Examples | Blog | Search | Free Support | Free Trial

VersionRelease Date
24.10.0October 25, 2024
24.9.0September 27, 2024
24.8.0August 27, 2024
24.7.0July 26, 2024
24.6.0June 27, 2024
24.5.0May 28, 2024
24.4.0April 29, 2024
24.3.0March 25, 2024
24.2.0February 29, 2024
24.1.1January 31, 2024
24.1.0January 30, 2024
23.12.0December 27, 2023
23.11.0November 28, 2023
23.10.0October 27, 2023
23.9.0September 22, 2023
23.8.0August 30, 2023
23.7.0July 14, 2023
23.6.0June 29, 2023
23.5.0May 19, 2023
23.4.0April 27, 2023
23.3.0March 27, 2023
23.2.0February 28, 2023
23.1.0January 31, 2023
22.12.0December 19, 2022
22.11.0November 24, 2022
22.10.0October 31, 2022
22.9.0September 16, 2022
22.8.0August 25, 2022
22.7.0August 15, 2022
22.3.0April 5, 2022
22.1.0February 1, 2022
21.12.0December 10, 2021
21.10.0October 13, 2021
21.9.0September 23, 2021
21.7.0July 22, 2021
21.7.2July 22, 2021
21.6.0June 29, 2021
21.3.0March 10, 2021
21.2.0February 4, 2021
20.12.0December 25, 2020
20.11.0November 10, 2020
20.10.0October 28, 2020
20.8.0August 19, 2020
1.0.0May 12, 2020
1.0.1May 12, 2020