Four types of royalty-free developer license with lifelong to use
EAN-13 Barcode Introduction
EAN-13 is also known as European Article Number 13, EAN-13 Supplement 5/Five-digit Add-On, EAN-13 Supplement 2/Two-digit Add-On, EAN-13+5, EAN-13+2, EAN13, EAN13+5, EAN13+2, UPC-13, GTIN-13, GS1-13, EAN/UCC-13.
A European Article Number (EAN) is a barcoding standard which is a superset of the original 12-digit Universal Product Code (UPC) system developed in North America. The EAN-13 barcode is defined by the standards organisation GS1. It is also called a Japanese Article Number (JAN) in Japan. UPC, EAN, and JAN numbers are collectively called Global Trade Item Numbers (GTIN), though they can be expressed in different types of barcodes.
The EAN-13 barcodes are used worldwide for marking retail goods. The less commonly used EAN-8 barcodes are used also for marking retail goods; however, they are usually reserved for smaller items, for example confectionery.
Sample of an EAN-13 Barcode
The value to encode by EAN-13 has the following structure:
2 or 3 digits for Number System or Country Code
5 or 4 digits for Manufacturer (Company) Code or prefix
5 digits for Product Code
1 digit for checksum
Each country has a numbering authority which assigns manufacturer codes to companies within its jurisdiction.
Add-On or Supplement code
The Add-On Symbols were designed to encode information supplementary to that in the main bar code symbol on periodicals and paperback books. The Add-On can be composed of 2 or 5 digits only.
Sample of an EAN-13 Five-Digit Add-On Barcode
Sample of an EAN-13 Five-Digit Add-On Barcode
EAN-13 Encoding Data Scope
EAN13 Barcode for Java supports:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
How to Generate EAN-13 Barcode in Java Class?
The following Java code illustrates how to create a EAN-13 barcode, and output to various formats.
1 Linear linear = new Linear(); 2 linear.setType(Linear.EAN13); 3 linear.setData("123456789012"); 4 linear.renderBarcode("c:/barcode.gif");
Encode generated EAN-13 barcode into gif image file (line 4)
Generate EAN-13 and output to BufferedImage object (line 5)
Generate EAN-13 in bitmap and output to byte[] (line 6)
Generate EAN-13 and draw to defined area (Rectangle2D) on Graphics2D (line 7-9)
Generate EAN-13 and output to OutputStream (line 10-11)
Note: The complete EAN 13 barcode data consists of the first 12 digits and the final check digit. When providing the EAN 13 data using the Java Barcode library, you may supply either the first 12 data digits or the complete 13 digits.
EAN 13 Add on Code
EAN 13 may include a 2 digit or 5 digit add on code. Call the setSupData() method to include the add on code when using the Java Barcode Generator library.
EAN 13 Valid Encoding Character Set in Java
EAN 13 barcodes encode digits (0–9) only. The valid EAN 13 data size is 13 digits, comprising the first 12 data digits and the final check digit. Using the BarcodeLib Java Barcode Generator library, you can input either the first 12 data digits or the complete 13 digits.
Add on Code
EAN 13 may include a 2 digit or 5 digit add on code.
How to Print EAN 13 Barcodes with Customized Text Label Font in Java
The GS1 standard recommends the OCR B font for the human readable text of EAN 13 barcodes. Using the Java barcode library, you can customize the EAN 13 barcode text font via the setTextFont() method.
Create and Customize EAN 13 Barcodes in Java Applications
Using the BarcodeLib Java Barcode Generator library, you can apply the following barcode options to further customize EAN 13 barcode labels in Java classes, JSP pages, Servlets, BIRT reports, and Jasper Reports applications.
ShowQuietZoneIndicator: Display or hide the EAN barcode quiet zone indicator. The default value is true.
UPCEANLeadDigitSpace: The space between the first digit and the start character bar. The default value is 0.
UPCEANTrailDigitSpace: The space between the stop character bar and the quiet zone indicator. The default value is 0.
EAN Barcode Quiet Zone Indicator
You can choose to show or hide the EAN 13 barcode quiet zone indicator. By default, the Java barcode generation library prints the quiet zone indicator mark at the end of the EAN 13 barcode. The ShowQuietZoneIndicator property controls this behavior.
EAN 13 First and Last Digit Spacing
Using the Java Barcode library, you can increase the space between the EAN 13 first digit and the start bar, as well as the space between the stop character and the quiet zone indicator, using the UPCEANLeadDigitSpace and UPCEANTrailDigitSpace properties in your Java class, Servlet, Jasper, or BIRT report projects.