Generate Aztec Barcode in Java.

Aztec barcode is one of the efficient barcodes that can contain information with high accuracy in a small area. In some scenarios, you might want to create an Aztec code with different symbol modes and error corrections. Following such requirements, this article covers how to generate an Aztec Barcode programmatically in Java.

API Installation to Generate Aztec Barcode - Free Download

You may work with Aspose.BarCode for Java library to generate or read different types of barcodes. Quickly download the relevant JAR file in your application by using the following configurations in the pom.xml file to download it from Aspose Repository.

    <name>Aspose Java API</name>

Generate Aztec Barcode in Java

You need to follow the steps below to generate Aztec barcode in Java applications:

  1. Create an instance of BarcodeGenerator class.
  2. Set the number of layers by specifying the symbol mode.
  3. Generate the Aztec code and export it as an image.

The below code sample shows how to generate an Aztec barcode programmatically in Java:

Generate Aztec with Error Correction in Java

The steps below demonstrate how to create an Aztec barcode with error correction in Java.

  1. Call the constructor of BarcodeGenerator class and pass the EncodeType parameter.
  2. Specify the symbol mode and the error correction capacity.
  3. Export the output Aztec code as PNG image.

The following code snippet elaborates how to generate an Aztec code with error correction in Java:

The image below is a sample of the output Aztec barcode with 50% error correction:

Aztec Error Correction in Java

Get a Free License

You may evaluate the API features by obtaining a free temporary license. This will enable you to avoid the evaluation watermark and limitations.


In this article, you have learned how to generate an Aztec barcode programmatically in Java. The accuracy of Aztec code is good enough so it is commonly used in scenarios where different documents are scanned or sent over the fax. Moreover, the number of layers can be controlled by changing the symbol modes to create a compact or full-range Aztec code. Furthermore, you may visit the API documentation to explore various other features. In case of any queries, please reach out to us at forum.

See Also