We would like to know which Barcode Jar is support Latin character,Code39 ,EAN13 and EAN8
To support Latin characters, Code 39, EAN-13, and EAN-8 barcodes in Java, you can use the Aspose.BarCode library. Here’s a brief overview of each barcode type:
-
Code 39: This barcode type allows encoding of uppercase English letters (A-Z), numerical digits (0-9), and a few special characters. It is a variable-length barcode and does not require a mandatory checksum, making it widely used in various industries.
-
EAN-13: This barcode type is specifically designed for encoding numerical digits. It requires exactly 12 digits, with the 13th digit serving as a control sum calculated using a specific algorithm.
-
EAN-8: Similar to EAN-13, this barcode type is also limited to numerical digits but is shorter, allowing for 7 digits of data with an 8th digit as a control sum.
To generate these barcodes using Aspose.BarCode for Java, you can create an instance of the BarcodeGenerator
class, set the barcode type, and provide the data to be encoded. Here’s a sample code snippet for generating these barcodes:
import com.aspose.barcode.*;
public class BarcodeExample {
public static void main(String[] args) {
// Create a BarcodeGenerator instance for Code 39
BarcodeGenerator code39Generator = new BarcodeGenerator(EncodeTypes.CODE39, "SampleData");
code39Generator.save("Code39.png");
// Create a BarcodeGenerator instance for EAN-13
BarcodeGenerator ean13Generator = new BarcodeGenerator(EncodeTypes.EAN13, "123456789012");
ean13Generator.save("EAN13.png");
// Create a BarcodeGenerator instance for EAN-8
BarcodeGenerator ean8Generator = new BarcodeGenerator(EncodeTypes.EAN8, "1234567");
ean8Generator.save("EAN8.png");
}
}
This code will generate three barcode images: one for Code 39, one for EAN-13, and one for EAN-8, each saved as a PNG file. Make sure to include the Aspose.BarCode library in your project to use these classes and methods.
For more detailed information, you can refer to the official Aspose documentation on barcode generation here.
Sources:
[1]: Barcode Generation Specifics in Java - Aspose Documentation
[2]: Code 39 - Aspose Documentation