Java Barcode UPC-E Generator

Create, Generate, Draw, Print Barcode UPC-E in Java Application


  • Easy to generate UPC-E barcodes in Java Class, J2EE applications
  • Simple to redistribute Java UPC-E barcode library. No registration key. No activation code.
  • Generating high quality UPC-E Bar Code images in GIF, PNG, JPEG, EPS & BITMAP
  • Generate UPC-E barcodes in Jasper Reports, iReport & Eclipse BIRT
  • Completely developed in Java
  • Mature UPC-E barcode generation Java library used by 2000+ clients
Index
 

Java Barcode UPC-E Generator Introduction

Java Barcode is a Java barcode generator which generates high quality 1D (linear) and 2D (matrix) barcodes in Java, Jasper Reports, iReport, and Eclipse BIRT projects.

 

Barcode UPC-E Introduction

UPC-E is also known as Universal Product Code version E, UPC-E Supplement 5/Five-digit Add-On, UPC-E Supplement 2/Two-digit Add-On, UPC-E+5, UPC-E+2, UPC-E0, E0, UPC-E1, E1, GTIN-12 with lead "0", GS1-12, UCC-12

 

Java UPC E Generator - Valid Data Scope

Java UPC E Generator encodes:



 

Java Barcode UPC-E Generation FAQ?

  1. How to generate barcode UPC-E in Java class?

    // Create Java UPCE object 
    UPCE barcode = new UPCE(); 
    
    // Set UPC-E data text to encode. It must be 6 digits, without the first number system and the last checksum digit.
    barcode.setData("123456"); 
    
    // Generate UPC-E barcode & print into Graphics2D object
    barcode.drawBarcode("Java Graphics2D object"); 
    
    // Generate UPC-E barcode & encode into GIF format
    barcode.drawBarcode("C://barcode-upce.gif"); 
    
    // Generate UPC-E barcode & encode into JPEG format
    barcode.drawBarcode("C://barcode-upce.jpg"); 
    
    


  2. How to generate & encode UPC-E barcodes to EPS?

    // Create Java UPCE object 
    UPCE barcode = new UPCE(); 
    
    // Set UPC-E data text to encode. It must be 6 digits, without the first number system and the last checksum digit.
    barcode.setData("123456"); 
    
    // Generate UPCE barcode & encode into EPS
    barcode.drawBarcode2EPS("C://barcode-upce.eps"); 


  3. How to create & encode UPC-E image in html or jsp pages?



    • Under demo package, copy barcode folder and its contents to your tomcat.

    • Start tomcat, navigate to http://YourDomain:Port/barcode/barcode?DATA=123456&TYPE=UPCE

    • To create bar code images in html or jsp pages, you can insert a image tag (img) into your page.
      For example, <img src="http://YourDomain:Port/barcode/barcode?DATA=123456&TYPE=UPCE" />



  4. How to create & print barcode UPC-E image in Java Servlet class?

    import com.onbarcode.barcode.AbstractBarcode; 
    import com.onbarcode.barcode.UPCE; 
    import javax.servlet.http.HttpServlet; 
    import javax.servlet.http.HttpServletRequest; 
    import javax.servlet.http.HttpServletResponse; 
    import javax.servlet.ServletException; 
    import javax.servlet.ServletOutputStream; 
       
    public class BarcodeServlet extends HttpServlet 
    { 
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException 
        { 
            try { 
                UPCE barcode = new UPCE(); 
                barcode.setData("123456"); 
                     
                ServletOutputStream servletoutputstream = response.getOutputStream(); 
                  
                response.setContentType("image/jpeg"); 
                response.setHeader("Pragma", "no-cache"); 
                response.setHeader("Cache-Control", "no-cache"); 
                response.setDateHeader("Expires", 0); 
               
                // Generate UPCE barcode & output to ServletOutputStream
                barcode.drawBarcode(servletoutputstream); 
          
            } catch (Exception e) { 
                throw new ServletException(e); 
            } 
        } 
    } 


  5. How to generate & print barcode UPC-E image in Jasper Reports?



    Complete Guide for Barcode Generation in Jasper Reports

  6. How to generate & print barcode UPC-E image in iReport?



    Complete Guide for Barcode Generation in iReport

  7. How to generate & print barcode UPC-E image in Eclipse BIRT?



    Complete Guide for Barcode Generation in Eclipse BIRT

  8. How to set generated barcode UPC-E image width and height?

    1) You can set barcode image width and height through properties barcodeWidth and barcodeHeight values.

    or

    2) You can set X (bar module width) and Y (bar module height) values

 

Java UPC-E Generator - Property Settings


Java UPC-E Generator in Java Class: com.onbarcode.barcode.UPCE

Category Class Properties Servlet Properties Default Comments
Basic data DATA "" value to encode. valid data is 6 digits
addCheckSum ADD-CHECK-SUM true addCheckSum property is not applied here. Barcode Library will always add a check character in the last digit (modulo 10). The UPC-E check digit has the same value of the check digit on the equivalent UPC-A number.
 
UPC/EAN Related supData SUP-DATA "" Set the supData property with the supplementary data to encode.
supHeight SUP-HEIGHT 0.8 This is a multiplicator of the height of the code; The default is 0.8 (80%).
supSpace SUP-SPACE 15 The separation between the barcode and the supplement
 
Size Related uom UOM 0 Unit of meature for all size related setting in the library.
0: pixel; 1: inch; 2: cm.
X X 1 width of barcode module (narrow bar), default is 1 pixel
Y Y 30 barcode module height, default is 30 pixel
barcodeWidth BARCODE-WIDTH 0 generted barcode image width
barcodeHeight BARCODE-HEIGHT 0 generted barcode image height
leftMargin LEFT-MARGIN 0 image left margin
rightMargin RIGHT-MARGIN 0 image right margin
topMargin TOP-MARGIN 0 image top margin
bottomMargin BOTTOM-MARGIN 0 image bottom margin
resolution RESOLUTION 72 in DPI
rotate ROTATE IBarcode.ROTATE_0 (0) valid values:
IBarcode.ROTATE_0 (0),
IBarcode.ROTATE_90 (1),
IBarcode.ROTATE_180 (2),
IBarcode.ROTATE_270 (3)
 
Text
&
Color
showText SHOW-TEXT true If true, display barcode data text, otherwise do not display.
showCheckSumChar SHOW-CHECKSUM-CHAR true If true, display the check sum character in the end of data, if there is a check sum.
textFont TEXT-FONT Arial, Plain, 11 Barcode text font style
textMargin TEXT-MARGIN 6 Space between barcode and barcode data text, default is 6 pixel



All Java Barcode Generator Supporting Bar Code Symbology Types



Java Barcode Generator Tutorial