Java Barcode Generation Guide | Java Barcode Generator User Guide
Java Barcode offers the most affordable Java barcode generator for barcode Java professionals.
Java Barcode Generator - Package Overview
KeepDynamic Java Barcode generator package is a mature barcode generator Java library.
Single jar file in the package allows Java developers to generate 40+ linear & 2D barcodes in various Java projects.
KeepDynamic Java Barcode generator package includes the following components:
- Java Barcode class library - includes all necessary Java class files for java barcode generation
- Java Servlet application - to generate barcodes in HTTP request
Java Barcode Generator - Installation
Java Barcode Generator is easy to install. Developers just add jar file to the Java project classpath environment.
To 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.
Java Barcode Generator - How to generate barcodes in Java Class?
The following Java code illustrates how to generate a barcode in Java class:
BarCode barcode = new BarCode();
barcode.setSymbologyType(BarCode.CODE128);
barcode.setCodeText("CODE128");
BufferedImage barcodeImage = barcode.drawBarCode2Image();
Java Barcode Generator - How to generate linear & 2D 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.CODE128);
barcode.setCodeText("CODE128");
ServletOutputStream servletoutputstream = response.getOutputStream();
barcode.drawBarCode2Stream(servletoutputstream);
} catch (Exception e) {
throw new ServletException(e);
}
}
}
Java Barcode Generator - How to create 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=CODE128&symbology-type=8
-
You can also insert barcodes in HTML or JSP pages.
<img src="http://your_tomcat_url:port/barcode/barCode?code-text=CODE128&symbology-type=8">
Java Barcode Generator - How to draw & print barcode 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.CODE128);
barcode.setCodeText("CODE128");
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 Barcode Generator - Java Reporting Implementation
Java Barcode Generator supports embeding barcodes in Java reporting solutions, like Eclipse BIRT, Jasper Reports, and iReport.
KeepDynamic Java Barcode generator support the following Java reporting solutions, click to view the details:
Java Barcode Generator - Barcode Type Property Settings
Java Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including: