Java EAN-13 Generator Library SDK Integration & Developer Guide
Generate barcode EAN-13 images in Java class, Servlet, JSP, J2EE with complete sample Java source code
- Generate, create EAN-13 in Java applications
- Easy to install & integrate barcode EAN-13 generation library SDK into Java developments
- Generate over 30 linear, 2d barcode images in Java including
Java QR Code,
Java Data Matrix,
Java GS1-128,
Java UPC,
Java PDF-417,
Java Code 128
- Generate EAN-13 images in Java class, Java Bean, Swing, Applet, J2SE
- Create barcode EAN-13 in Java web application, including Servlet, JSP, EJB, Tomcat, JBoss, J2EE
- Create & Print EAN-13 barcode in BIRT reports designer and BIRT report runtime
- Generate & Draw EAN-13 in Jasper Reports, iReport
- Encode EAN-13 images to jpeg, eps, gif, png, tiff, bitmap files in Java program
Index
Java EAN-13 Generator Introduction
EAN-13, also known as European Article Number 13, UPC-13, GTIN-13, GS1-13, EAN/UCC-13, is the standard barcode version of European Article Number.
Generate and create EAN-13 barcode using Java is one of the functions in OnBarcode's
Barcode for Java Generating Java library (jar file), which supports
generating & printing EAN-13 and 20+ other linear & 2D bar codes in Java application and software.
EAN-13 Generator and Reader library, SDK & application
EAN-13 Generator components and software include
.NET EAN-13,
C# EAN-13,
VB.NET EAN-13,
ASP.NET EAN-13,
EAN-13 Generator.
This document is providing a detailed Java sample source code about generating EAN-13 barcodes in Java class using
Java Barcode generation component.
Complete EAN-13 custmoization settings is included in
Java EAN-13 generating guide.
Generate EAN-13 Barcodes in Java
Generating EAN-13 barcode in Java class example:
EAN13 barcode = new EAN13();
/*
EAN 13 Valid data char set:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)
EAN 13 Valid data length: 12 digits only, excluding the last checksum digit
*/
barcode.setData("012345678901");
// for EAN13 with supplement data (2 or 5 digits)
/*
barcode.setSupData("12");
// supplement bar height vs bar height ratio
barcode.setSupHeight(0.8f);
// space between barcode and supplement barcode (in pixel)
barcode.setSupSpace(15);
*/
// EAN 13 Unit of Measure, pixel, cm, or inch
barcode.setUom(IBarcode.UOM_PIXEL);
// EAN 13 bar module width (X) in pixel
barcode.setX(3f);
// EAN 13 bar module height (Y) in pixel
barcode.setY(75f);
// barcode image margins
barcode.setLeftMargin(0f);
barcode.setRightMargin(0f);
barcode.setTopMargin(0f);
barcode.setBottomMargin(0f);
// barcode image resolution in dpi
barcode.setResolution(72);
// disply barcode encoding data below the barcode
barcode.setShowText(true);
// barcode encoding data font style
barcode.setTextFont(new Font("Arial", 0, 12));
// space between barcode and barcode encoding data
barcode.setTextMargin(6);
// barcode displaying angle
barcode.setRotate(IBarcode.ROTATE_0);
barcode.drawBarcode("C:\\ean13.gif");
Java Barcode Generation Demo Source Codes: