KA.Barcode for Java
Guide for Resizing EAN 13 Barcodes in Java
Complete Java source code to generate, print EAN 13 images and change barcode size with Java Control
EAN-13 Barcode Generator for Java Features
  • Supports Java Reports software to set your wanted size of EAN-13
  • Completely developed in Java for any operating systems with Java Virtual Machine.
  • Pre-configured industry standards EAN-13 allow any untrained users to insert EAN-13 in Java
  • Provide professional features to set inter-character space and wide narrow bar ratio for EAN-13
  • Unit of Measure can change the generated EAN-13 image in Inch, CM or Pixel
  • The generated EAN-13 image resolution can be set to be a fixed value with your need
  • Encode EAN-13 valid data with valid data length to generate EAN-13 images in Java
EAN-13 Java Generation Setting Related Guide
EAN-13, aka European Article Number 13, EAN/UCC-13, GS1-13, GTIN-13, with variants EAN-13 Supplement 2 (a two-digit Add-On), EAN-13 Supplement 5(a five-digit add-on). Java EAN 13 generation SDK is developed for all EAN 13 generation in Java applications with full EAN-13 generation solutions. Except Java EAN-13 Size Setting page, two other EAN-13 generations pages are provided for easier EAN 13 generation procedure.
Java EAN-13 Size Setting Parameters

Set supHeight & supSpace for EAN-13 in Java

As EAN-13 can be added supplement data in Java application, therefore, the the height and width of EAN-13 generated in Java can also be set to change the size of the EAN 13 image in Java applcations.

barcode.setsupHeight(0.9);// the height of the supplement barcode (Default: 0.8)

barcode.setsupSpace(16);// the space between the main barcode and the supplement barcode (Default: 15 pixels)

Customize the Width of EAN-13 on Java

For Java EAN 13 image width, the following properties can be set the change the width of EAN 13 created in Java.

barcode.setX(2);// the width of the EAN-13 bar module, default is 2 pixel

barcode.setBarCodeWidth(100);// the fixed width value of EAN-13 image, default is 0

barcode.setleftMargin(2);// the space between the left side and bars in EAN-13 generated by Java EAN-13

barcode.setrightMargin(2);// the space between the right side and bars in EAN-13 generated by Java EAN-13, default is 0

Adjust the height of EAN-13 in Java

As for the height of EAN 13 image in java, the option below you can choose to set to meet your need.

barcode.setY(50);// the height value of EAN-13 bar module, default is 75 pixel

barcode.setBarCodeHeight(100);// the fixed height value of EAN-13 image, default is 0

barcode.settopMargin(2);// the space between the top side and bars, default is 0

barcode.setbottomMargin(2);// the space between the bottom side and bars, default is 0

In addition, the EAN-13 image size can be changed with UOM and autoResize.

barcode.setUOM(IBarCode.UOM_PIXEL);// Unit of measure for all size related properties. UOM_PIXEL (0); UOM_CM (1); UOM_INCH (2). Default is UOM_PIXEL (0)

barcode.setautoResize(true);// adjust the size with your setting properties with set it to be ture

barcode.settextFont("Arial", Font.PLAIN, 11);//the text font style of the generated EAN-13, default is new Font("Arial", Font.PLAIN, 11)

EAN-13 Size Setting in Java - Common situations

Generate EAN-13 image with a fixed Bar Width in Java

In java applications, EAN-13 bar width can be set with the property - X. To set a fixed X, the EAN-13 image will be printed with the minimum X.
  • Set the minimum value of X. For example, barcode.setX(4);
  • Set the autoResize to be false. For example,barcode.setautoReisize(false);
  • Adjust other option with your need

Create EAN-13 image with a fixed Image Width in Java

In java applications, EAN-13 image width can be set with the property - BarCodeWidth. To set a fixed image width, the EAN-13 image will be drawn with the fixed image width.
  • Set the fixed value of BarCodeWidth. For example, barcode.setBarCodeWidth (200);
  • Set the autoResize to be true. For example,barcode.setautoReisize(true);
  • Adjust other option with your need

Draw EAN-13 image with a Minimum X and BarCodeWidth in Java

In java applications, EAN-13 image size can be changed with X and BarCodeWidth at the same time.
  • Set the minimum value of X. For example, barcode.setX(4);
  • Set the fixed value of BarCodeWidth. For example, barcode.setBarCodeWidth (200);
  • Set the autoResize to be false. For example,barcode.setautoReisize(false);
  • Adjust other option with your need
Note that, once setting a fixed X, a minimum BarCodeWidth EAN-13 image is automatically created in Java. If your set BarCodeWidth is smaller than the minimum value, the generated EAN-13 image width will be the minimum barcode width value in java; If your set BarCodeWidth is larger than the minimum value, the generated EAN-13 image width will be the set barcode width value in java. This situation is the same as BarCodeHeight.