Developer Guide for Java Barcode Generator

How to create linear & 2d barcodes with Java barcode generation SDK
Java Barcode Trial Package
Java Barcode Trial Package
Barcode Java > Barcode in Java
Terrek.Barcode for Java - Benefits
Generating, printing & streaming linear & 2D barcodes with Java barcode generation SDK

Development Environment

Easily generate, print linear & 2D barcodes in Java Class (Java bean, classes), Java Server Side (JSP, Servlet, Web service), Java Client (Applet, Swing), Java Reporting ( Barcode Jasper Reports, Barcode iReport, Oracle Reports, Crystal Reports for Java, Barcode BIRT).

Available Barcode Types

Linear types: Codabar, Code 11, Code 2 of 5, Code 39, Code 128, EAN-8, EAN-13, GS1 128, Identcode, Intelligent Mail, Interleaved 2 of 5, ISBN, ISSN, ITF-14, Leitcode, MSI Plessey, Planet, Postnet, RM4SCC, UPC-A, UPC-E
2D types: Data Matrix, QR Code, PDF-417

Barcode Size Options

Easily customize barcode size, including X, Y dimension, barcode width and height, alignment, margin of right, left, top and bottom

Barcode Image Formats

Easily draw, print & stream high-quality linear & 2D barcode images into GIF, PNG, JPEG & BITMAP with customized background and background color, orientation, resolution

ISO Barcode Standard

Compatible with the latest ISO barcode standard

GS1 Standard

Easily generate GS1 compatible linear & 2D barcodes
Terrek.Barcode for Java - Trial Package Overview
Barcode for Java trial package includes:

.jar proofile

Terrekā€™s barcode.jar includes 20+ barcode types and 50+ barcode properties for making Linear and 2D barcodes in Java programs.


A complete developer guide for Java barcode generator
Terrek.Barcode for Java - Compatibility and Installation


  • InteliJ IDEA
  • JDK 1.4 and above
  • Tomcat


  1. Download and extract.
  2. Install Java with Tomcat.
  3. Add barcode.jar to the path environment.
  4. Copy barcode.jar to your production directory of choice.
  5. Generate barcode with your need.
(For more features with detailed information, see Linear Barcodes Tutorial and 2D Barcodes Tutorial)
Terrek.Barcode for Java - Barcode Generation

Generate barcodes in Java class by changing the barcode properties.

// Create Java Code25 object
Code25 barcode = new Code25();

// Set barcode data text to encode

// Generate barcode & print into Graphics2D object
barcode.drawBarcode("Java Graphics2D object");

// Generate barcode & encode into GIF format
barcode.drawBarcode("C://barcode- code25.gif");

// Generate barcode & encode into JPEG format
barcode.drawBarcode("C://barcode- code25.jpg");

Generate & encode barcodes to EPS by changing the concerned values.

// Create Java barcode object
Codbar barcode = new Code25();

// Set barcode data text to encode
barcode.setData("Generate Barcode in EPS using Java");

// Generate barcode & encode into EPS format
barcode.drawBarcode2EPS("C://barcode- code25.eps");

Generate & encode barcodes in html or jsp pages.

Copy barcode folder and its contents from demo package to Apache Tomcat.

Start Apache Tomcat, go to http://YourDomain:Port/barcode/barcode?DATA=7654321&TYPE=CODE25

Insert an image tag (img) into your page. For example,

Customize the width and height of generated barcode image

You can choose to set the values of the barcodeWidth and barcodeHeight properties or set X (bar module width) and Y (bar module height) values.