Four types of royalty-free developer license with lifelong to use
EAN-8 Barcode Introduction
EAN-8 is also known as European Article Number 8, EAN-8 Supplement 5/Five-digit Add-On, EAN-8 Supplement 2/Two-digit Add-On, EAN-8+5, EAN-8+2, EAN8, EAN8+5, EAN13+2, UPC-8, GTIN-8, GS1-8, EAN/UCC-8.
An EAN-8 is a barcode and is derived from the longer European Article Number (EAN-13) code. It was introduced mainly to use on small packages where an EAN-13 barcode would be impractical; for example on cigarettes, pencils even though not used very common and chewing gum packets.
EAN-8 is a shortened version of the EAN-13 code. It includes a 2 or 3 digit country code, 4 or 5 data digits (depending on the length of the country code), and a checksum digit. The primary purpose of the EAN-8 is to be used on small packages, so the code must use as little space as possible.
EAN-8 codes are most common in the UK, and as such many UK-based companies use blocks of EAN-8 codes for own-brand products which are only sold in their stores. These are formatted as 1xxx xxxx.
Sample of an EAN-8 Barcode
EAN-8 Encoding Data Scope
EAN-8 Barcode for Java supports:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
How to Generate EAN-8 Barcode in Java Class?
The following Java code illustrates how to create a EAN-8 barcode, and output to various formats.
1 Linear linear = new Linear(); 2 linear.setType(Linear.EAN8); 3 linear.setData("2012345"); 4 linear.renderBarcode("c:/barcode.gif");
Under java_barcode_trial package, copy barcode folder to your java servlet container like tomcat.
Restart tomcat. Now you have installed successfully.
To test your installation, open your web browser and navigate to: http://YourDomain:Port/barcode/linear?Data=1234567&Type=EAN8
To create barcode image in your JSP or html page, you need pass the url to IMG tag src value. For example, <img src="http://YourDomain:Port/barcode/linear?Data=1234567&Type=EAN8" /> Using this method, it will not generate any barcode images in your server side.
The second method is to generate barcode images in your server side.
Create a barcode image in server side, like Linear linear = new Linear(); linear.setData("1234567"); linear.setType(Linear.EAN8); linear.renderBarcode("C:/Tools/Tomcat 5.5/webapps/YourWebApp/barcode-images/barcode.gif");
In your JSP or HTML page, you need use IMG tag to display generated image, like <img src="http://YourDomain:Port/YourWebApp/barcode-images/barcode.gif" />
How to Generate Barcode EAN-8 Image in Jasper Reports, iReport, Eclipse BIRT?
Set the type property to Linear.EAN8 or Linear.EAN8_2 or Linear.EAN8_5 Servlet URL Parameter: "Type". Value: 7 (EAN8), 8 (EAN8 +2), 9 (EAN8 +5). Sample: &Type=7.
Set the data property with the value to encode. Type is String. User should only provide 7 digits, and DO NOT include last digit checksum character. Servlet URL Parameter: Data.
Valid Data Scope:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Valid Data Format:7 digits. There are totally 8 digits in EAN-8 barcode, first 7 digits are barcode value, and last digit is the checksum digit, which is generated by barcode library automatically.
Sample: barcode.Data = "1234567".
Set the sData property with the supplement value to encode. Type is String. Provide 2 digits for barcode type EAN8_2, and provide 5 digits for type EAN8_5. Sample for Linear.EAN8_2: barcode.setSData("12"). Sample for Linear.EAN8_5: barcode.setSData("12345"). Servlet URL Parameter: SData.
addCheckSum property is not applied here. Barcode Library will always add a check character in the last digit (modulo 10).
Barcode image size settings.
Set property uom (Unit of Measure) for properties X, Y, leftMargin, rightMargin, topMargin and bottomMargin. Default is Linear.UOM_PIXEL (0). Valid values are Linear.UOM_PIXEL (0), Linear.UOM_CM (1), Linear.UOM_Inch (2). Servlet URL Parameter: "UOM". Value: 0 (pixel), 1 (cm), 2 (inch). Sample: &UOM=0.
Set the X (for barcode module width) and Y (for barcode module height) properties. Both types are float. Default X is 3. Y is 75. Servlet URL Parameter: "X", "Y". Sample: &X=3&Y=75.
Set the leftMargin, rightMargin, topMargin and bottomMargin properties, and types are all float. Default values are 0 for all 4 margin settings. Servlet URL Parameter: "LeftMargin", "RightMargin", "TopMargin", "BottomMargin". Sample: &LeftMargin=0.
Set the resolution property (Value is expressed in DPI - Dots per inch). Default is 72 dpi. Servlet URL Parameter: "Resolution". Sample: &Resolution=72.
Setting up text style in barcode image.
Set the showText properties. If this value is true, barcode data will be displayed with the barcode. Default is true. Servlet URL Parameter: "ShowText". Value: "t" (true), "f" (false). Sample: &ShowText=t.
Set the textFont property. The font used to display text in barcode image. Default is new Font("Arial", Font.PLAIN, 11). Servlet URL Parameter: "TextFont". Value format: [font name]|[font style]|[font size]. Sample Values: &TextFont=Arial|Bold|12
With rotate property, you can display barcode horizontally or vertically. Default value is 0. Servlet URL Parameter: "Rotate". Sample: &Rotate=0. Value can be: