Generate Maxicode Barcode in Java.

Maxicode is a 2D barcode created with a combination of dots in a hexagonal shape. They are commonly used for supply chain management, object hyperlinking, and many other purposes. In some use cases, you may need to create a Maxicode for different requirements. Accordingly, this article explains how to create Maxicode barcodes with different encoding types, as well as with aspect ratio programmatically in Java.

Java Configuration to Generate Maxicode Barcode - Free API Download

You can generate or read many types of barcodes with Aspose.BarCode for Java. Quickly download the JAR files from the New Releases page or use the configurations below to set it up from the 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.9</version>
</dependency>

Generate Maxicode Barcode in Java

The following steps show how to generate a Maxicode barcode:

  1. Create an object of the BarcodeGenerator class and specify the EncodeType value.
  2. Set the size as the number of pixels.
  3. Set MaxiCode encode mode and valid codetext.
  4. Create the Maxicode barcode and export the output image in PNG format.

The code snippet below demonstrates how to generate a Maxicode barcode programmatically in Java:

Generate Maxicode Barcode with Aspect Ratio in Java

You need to follow the steps below to generate the Maxicode barcode with aspect ratio in Java.

  1. Initialize an instance of BarcodeGenerator class and specify the EncodeType.
  2. Set the aspect ratio for the Maxicode.
  3. Generate the Maxicode barcode as a PNG image.

The following sample code shows how to generate a Maxicode barcode with aspect ratio programmatically in Java:

The screenshot below shows how the Maxicode looks when it is created with the above code sample:

Generate Maxicode Aspect Ratio in C#

Get a Free License

You can work with the API without any limitations or evaluation watermark by getting a free temporary license.

Conclusion

In this article, you have explored how to create or generate a Maxicode barcode programmatically in Java. It elaborates the process to create the Maxicode with encode modes 2, 3, and 4, as well as with aspect ratio. Moreover, you may go through the documentation space to check out many other features of the API. In case of any queries, please get in touch with us at forum.

See Also