Java Barcode Codabar Generator
Create, Generate, Draw, Print Barcode Codabar in Java Application
- Easy to generate Codabar barcodes in Java Class, J2EE applications
- Simple to redistribute Java Codabar barcode library. No registration key. No activation code.
- Generating high quality Codabar Bar Code images in GIF, PNG, JPEG, EPS & BITMAP
- Generate Codabar barcodes in Jasper Reports, iReport & Eclipse BIRT
- Completely developed in Java
- Mature Codabar barcode generation Java library used by 2000+ clients
Index
Java Barcode Codabar 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.
Codabar Barcode Introduction
Codabar is a linear barcode symbology developed in 1972 by Pitney Bowes Corp.
It is also known as Codeabar, Ames Code, NW-7, Monarch, Code 2 of 7, Rationalized Codabar, ANSI/AIM BC3-1995 or USD-4.
Java Codabar Generator - Codabar Valid Data Scope
Java Codabar Generator encodes 16 letters.
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- - (Dash), $ (Dollar), : (Colon), / (Slash), . (Point), + (Plus)
Java Barcode Codabar Generation FAQ?
How to generate barcode Codabar in Java class?
// Create Java Codabar object
Codabar barcode = new Codabar();
// Set Codabar data text to encode
barcode.setData("0123456789");
// Generate Codabar barcode & print into Graphics2D object
barcode.drawBarcode("Java Graphics2D object");
// Generate Codabar barcode & encode into GIF format
barcode.drawBarcode("C://barcode-codabar.gif");
// Generate Codabar barcode & encode into JPEG format
barcode.drawBarcode("C://barcode-codabar.jpg");
How to generate & encode Codabar barcodes to EPS?
// Create Java Codabar object
Codabar barcode = new Codabar();
// Set Codabar data text to encode
barcode.setData("0123456789");
// Generate Codabar barcode & encode into EPS
barcode.drawBarcode2EPS("C://barcode-codabar.eps");
How to create & encode Codabar 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=0123456789&TYPE=codabar
- 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=0123456789&TYPE=codabar" />
How to create & print barcode Codabar image in Java Servlet class?
import com.onbarcode.barcode.AbstractBarcode;
import com.onbarcode.barcode.Codabar;
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 {
Codabar barcode = new Codabar();
barcode.setData("0123456789");
ServletOutputStream servletoutputstream = response.getOutputStream();
response.setContentType("image/jpeg");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// Generate Codabar barcode & output to ServletOutputStream
barcode.drawBarcode(servletoutputstream);
} catch (Exception e) {
throw new ServletException(e);
}
}
}
How to generate & print barcode Codabar image in Jasper Reports?
Complete Guide for Barcode Generation in Jasper Reports
How to generate & print barcode Codabar image in iReport?
Complete Guide for Barcode Generation in iReport
How to generate & print barcode Codabar image in Eclipse BIRT?
Complete Guide for Barcode Generation in Eclipse BIRT
How to set generated barcode Codabar 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 Codabar Generator - Property Settings
Java Codabar Generator in Java Class: com.onbarcode.barcode.Codabar
| Category |
Class Properties |
Servlet Properties |
Default |
Comments |
| Basic |
data |
DATA |
"" |
value to encode |
| addCheckSum |
ADD-CHECK-SUM |
true |
addCheckSum property is not applied here. Codabar does not require any checksum. |
| |
Codabar Special |
startChar |
START-CHAR |
'A' |
Codabar start char, valid values: 'A', 'B', 'C', 'D' |
| stopChar |
STOP-CHAR |
'A' |
Codabar stop char, valid values: 'A', 'B', 'C', 'D' |
| |
| 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
1D / Linear Barcodes
- Codabar
- Code 11
- Code 39
- Extended Code 39
- Code 93
- Code 128
- UCC/EAN128 (GS1 128)
- Interleaved 2 of 5
- Code 2 of 5 (Industrial 2 of 5)
- ITF-14
- UPC-A, supplement 2, 5 digits
- UPC-E, supplement 2, 5 digits
- EAN-8, supplement 2, 5 digits
- EAN-13, supplement 2, 5 digits
- ISBN, supplement 2, 5 digits
- ISSN, supplement 2, 5 digits
- MSI Plessey
- POSTNET
- PLANET
- USPS Intelligent Mail Barcode (OneCode)
- Identcode
- Leitcode
- RM4SCC
|
|
|