KA.Barcode for Java
Guide for Resizing UPC-A Barcodes in Java
Complete Java source code to generate, print UPC-A images and change barcode size with Java Control
UPC-A Barcode Generator for Java Overview
  • Encode UPC-A valid data with valid data length to generate UPC-A images in Java
  • UPC-A barcode can be set in the center, right or left of the image
  • Show text can enable or disenable with Java UPC-A generator
  • High quality UPC-A images may be printed with any printers, including those low resolution printers
  • Easy to set the UPC-A barcode image width in Java by changing the X(width of barcode module)
  • A Srvlet, Applet, JavaBean and class library are contained in the Java UPC-A generator package
  • Royalty free with the purchase or Java UPC-A generator developer license
  • Check sum digit of UPC-A image can be automatically computed
Related UPC-A Java Generation Setting Guide
UPC-A, is also named as Universal Product Code version A, UPC-A+2, UPC-A Supplement 2 (Two-digit Add-On), UPC-A+5, UPC-A Supplement 5 (Five-digit Add-On), UPC Bar Code, UPC Symbol, GTIN-12, GS1-12. Excluding Java UPC-A Size Setting, KeepAutomation provides other concerned UPC-A generation setting properties for adjust the image and encoding data:
Java UPC-A Size Setting Aspects

supHeight & supSpace for UPC-A in Java

  • supHeight - the height of the supplement barcode (Default: 0.8)
  • supSpace - the space between the main barcode and the supplement barcode (Default: 15 pixels)

Sample code:

barcode.setsupHeight(0.9);

barcode.setsupSpace(16);

UOM and autoResize for UPC-A in Java

  • UOM - Unit of measure for all size related properties. UOM_PIXEL (0); UOM_CM (1); UOM_INCH (2). Default is UOM_PIXEL (0)
  • autoResize - adjust the size with your setting properties with set it to be ture

Sample code:

barcode.setUOM(IBarCode.UOM_PIXEL);

barcode.setautoResize(true);

Other common UPC-A size setting concerned properties in Java

  • X - the width of the UPC-A bar module, default is 2 pixel
  • Y - the height value of UPC-A bar module, default is 75 pixel
  • leftMargin - the space between the left side and bars in UPC-A generated by Java UPC-A
  • rightMargin - the space between the right side and bars in UPC-A generated by Java UPC-A, default is 0
  • topMargin - the space between the top side and bars, default is 0
  • bottomMargin - the space between the bottom side and bars, default is 0
  • barCodeWidth - the fixed width value of UPC-A image, default is 0
  • barCodeHeight - the fixed height value of UPC-A image, default is 0
  • textFont - the text font style of the generated UPC-A, default is new Font("Arial", Font.PLAIN, 11)

Sample code:

barcode.setX(2);

barcode.setY(50);

barcode.setBarCodeWidth(100);

barcode.setBarCodeHeight(100);

barcode.settopMargin(2);

barcode.setbottomMargin(2);

barcode.setleftMargin(2);

barcode.setrightMargin(2);

barcode.settextFont("Arial", Font.PLAIN, 11);

Net winforms is robust and powerful barcode component controller that lets you to integrate barcode generation features nto .net winforms or other...
With this barcode componet dll SDK, developers can easily generate multiple QR Code images in ....
KA.Barcode Generator for ASP.NET is a fully integrated SDK library to generate, display scannable high-quality QR Code images in ASP.NET webform /...
QR Code Image Setting in KA.Barcode Generator for ....
5. Now, you can change barcode types and customize image settings in the "Properties" window. How to Generate QR Code in .NET WinForms...
more>
UPC-A Size Setting in Java - Common situations

Generate UPC-A image with a fixed Bar Width in Java

In java applications, UPC-A bar width can be set with the property - X. To set a fixed X, the UPC-A 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 UPC-A image with a fixed Image Width in Java

In java applications, UPC-A image width can be set with the property - BarCodeWidth. To set a fixed image width, the UPC-A 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 UPC-A image with a Minimum X and BarCodeWidth in Java

In java applications, UPC-A 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 UPC-A image is automatically created in Java. If your set BarCodeWidth is smaller than the minimum value, the generated UPC-A image width will be the minimum barcode width value in java. If your set BarCodeWidth is larger than the minimum value, the generated UPC-A image width will be the set barcode width value in java. This situation is the same as BarCodeHeight.