Java Barcode Codabar Generator
Barcode Codabar Generation in Java Class, Jasper Reports, iReport, BIRT
Java Barcode offers the most affordable Java barcode generator for barcode Java professionals.
Java Codabar Introduction
Codabar is also known as Codeabar, Ames Code, NW-7, Monarch, Code 2 of 7, Rationalized Codabar, ANSI/AIM BC3-1995 or USD-4.
Java Barcode Codabar Generator - How to generate barcode Codabar in Java Class?
The following Java code illustrates how to generate a barcode in Java class:
BarCode barcode = new BarCode();
barcode.setSymbologyType(BarCode.CODABAR);
barcode.setCodeText("12345");
BufferedImage codabarImage = barcode.drawBarCode2Image();
Java Barcode Codabar Generator - How to generate Codabar barcodes to Java Servlet applicatons?
The following Java code illustrates how to generate a barcode in Java Servlet class:
public class BarcodeServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
try {
BarCode barcode = new BarCode();
barcode.setSymbologyType(BarCode.CODABAR);
barcode.setCodeText("12345");
ServletOutputStream servletoutputstream = response.getOutputStream();
barcode.drawBarCode2Stream(servletoutputstream);
} catch (Exception e) {
throw new ServletException(e);
}
}
}
Java Barcode Codabar Generator - How to create Codabar barcodes through HTTP Request?
-
Install Java Barcode Generator Servlet application to Tomcat or JBoss, developers need copy the barcode folder to your Tomcat application folder, and restart the Tomcat.
-
After Tomcat restarted, open your browser and navigate to http://your_tomcat_url:port/barcode/barCode?code-text=12345&symbology-type=1
-
You can also insert barcodes in HTML or JSP pages.
<img src="http://your_tomcat_url:port/barcode/barCode?code-text=12345678&symbology-type=1">
Java Barcode Codabar Generator - How to draw & print barcode Codabar to java.awt.Image Object
The following Java source code shows how to generate a barcode in a java.awt.Image object:
private static void demoLinearBarcode() throws Exception
{
BarCode barcode = new BarCode();
barcode.setSymbologyType(BarCode.CODABAR);
barcode.setCodeText("12345");
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(300,300,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED );
java.awt.Graphics2D imgGraphics = image.createGraphics();
barcode.paintBarCode(imgGraphics, new java.awt.Rectangle(0, 0, 300, 300));
}
Java Codabar Properties
Codabar Type Value: com.keepdynamic.barcode.generator.BarCode.CODABAR (1).