Java EAN-13 Generator Image Setting Tutorial
sample source code to generate linear EAN-13 in png, jpeg, etc. image formats in Java
- Easily generate high quality EAN-13 images on any operating system with a JVM
- Generate barcodes which can be added to Oracle Reports and Crystal Reports with ajusting EAN 13 image setting various properties
- Pre-configured industry standards EAN-13 allow any untrained users to insert EAN-13 in Java
- Java Server Side projects (JSP, Servlet, EJB, J2EE, Web Service) can be easily integrated
- Unit of Measure can set the generated EAN-13 image in Inch, CM or Pixel
- EAN-13 image color can be changed with setting BackColor, ForeColor and TextColor
- The generated EAN-13 image resolution can be set to be a fixed value with your need
- Valid character set and available data length can be referred in the EAN-13 page
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.
Java EAN-13 Size Setting is written to describe how to change the EAN 13 size with Java applications;
Java EAN-13 Data Encoding is written to describe how to encode EAN 13 valid digit set and length in Java.
Java EAN-13 Image Setting Components
Open an existing project or a new project for EAN 13 image setting and build a EAN 13 barcode object.
DataMatrix barcode = new DataMatrix();
//EAN 13 in Java can only encode 12 numeric digits
barcode.setData("124578124576");
EAN-13 Image Common Setting in Java
//For resolution of EAN 13 image
barcode.setResolution(68);
//For EAN 13 in Java angle 0 (IBarcode.ROTATE_0); 1 (IBarcode.ROTATE_90); 2 (IBarcode.ROTATE_180);
3 (IBarcode.ROTATE_270)
barcode.setRotate(IBarcode.ROTATE_180);
//For bar alignment of Java EAN 13 image, 0: left, 1: center, 2: right;
barcode.setbarAlignment(1(center));
//For EAN 13 background color
barcode.setbackColor(red);
//For EAN 13 foreground color
barcode.setforeColor(black);
//For EAN 13 text displaying or not
barcode.setshowText(true);
//For EAN 13 textColor in Java
barcode.settextColor(black);
EAN-13 Supplement Image Setting in Java
For EAN 13 image generated in Java can be divided into two parts if enable the supplement data for a supplement barcode at the right side of the EAN 13 image.
//For EAN 13 supplement data setting
barcode.setsupData("00");
//For EAN 13 supplement height,default is 0.8f
barcode.setsupHeight(2);
//For the space between EAN 13 barcode and supplement barcode, default is 15
barcode.setsupSpace(20);