EAN barcode is widely used in international trading to identify the details of different products. The EAN barcode is popular because of its efficiency as it can be processed faster, is less error-prone, and different variations exist for different scenarios. In certain cases, you may need to create an EAN code. Accordingly, this article explains how to create an EAN barcode programmatically in Java.
- Java EAN Barcode Generator API - Free Download
- Generate EAN 13 Barcode in Java
- Generate EAN 5 with Supplement Data in Java
Java EAN Barcode Generator API - Free Download
Aspose.BarCode for Java API supports creating or scanning many types of barcodes. You can easily set it up by accessing it from the downloads section or use the configurations below in your pom.xml file to enable it from Aspose Repository.
<name>Aspose Java API</name>
Generate EAN 13 Barcode in Java
The following steps elaborate on how to generate an EAN barcode programmatically in Java:
- Initialize an object of BarcodeGenerator class.
- Set the size in the number of pixels.
- Save the output EAN 13 barcode as an image.
The following code snippet demonstrates how to generate an EAN barcode programmatically in Java:
Generate EAN 5 with Supplement Data in Java
You can append additional digits to reflect specific information into the barcode. The following steps show how to generate EAN 5 barcode by appending digits to the EAN 13 code in Java.
- Create an instance of BarcodeGenerator class and set the EncodeType.
- Set the supplement space and supplement data.
- Save the output EAN 5 code as an image.
The code sample below shows how to generate an EAN 5 code with supplement data in Java:
The following image depicts the sample output of an EAN 5 code containing the supplement data:
Get a Free License
Interested to evaluate the API without any evaluation limitations? Request a free temporary license now to test the API to its full capacity.
In this article, you have understood how to generate an EAN barcode programmatically in Java. Moreover, the details to create EAN code with supplement data like EAN 5 and EAN 2 is also explained. Furthermore, you can find more details about other features of the API by visiting the documentation section. Please feel free to write to us at forum if you need to discuss any of your concerns.