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
- Generate Aztec Barcode in Java
- Generate Aztec with Error Correction 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.
<repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>http://repository.aspose.com/repo/</url> </repository>
<dependency> <groupId>com.aspose</groupId> <artifactId>aspose-barcode</artifactId> <version>22.8</version> </dependency>
Generate Aztec Barcode in Java
You need to follow the steps below to generate Aztec barcode in Java applications:
- Create an instance of BarcodeGenerator class.
- Set the number of layers by specifying the symbol mode.
- 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.
- Call the constructor of BarcodeGenerator class and pass the EncodeType parameter.
- Specify the symbol mode and the error correction capacity.
- 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:
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.