|
|
|||||||||||
Home > Barcode for Java > Java Barcode Generation Guide
Generating linear & 2D barcode images using Barcode for Java library, is a simply and easy task.
Quick access: Overview | Installation | for Java Class | for Java Web | for Java Reporting | Barcode Properties Barcode for Java Trial Package Overview
Barcode for Java is a mature & reliable Java barcode generator library for linear & 2d barcode generation in J2SE, J2EE, and Java reporting frameworks (Jasper Reports, iReport and Eclipse BIRT).
Install Barcode for Java library
How to Generate Barcodes in Java Class?Install: Copy barcode.jar file to your Java project library folder, and add barcode.jar to your project reference The following Java code illustrates how to generate a 1d (linear) barcode in a Java class
1 Linear linear = new Linear();
2 linear.setData("123456789");
3 linear.setType(Linear.CODE128);
4 linear.renderBarcode("c:/barcode.gif");
5 BufferedImage bufferedImage = linear.renderBarcode();
6 byte[] barcodeBytes = linear.renderBarcodeToBytes();
7 Graphics2D g = ...
8 Rectangle2D rectangle = ...
9 linear.renderBarcode(g, rectangle);
10 OutputStream outputStream = ...
11 linear.renderBarcode(outputStream);
Generate Data Matrix barcodes in Java class
1 DataMatrix barcode = new DataMatrix();
2 barcode.setData("DATA MATRIX");
// add more Data Matrix property settings here
3 barcode.renderBarcode("c:/barcode.gif");
4 BufferedImage bufferedImage = barcode.renderBarcode();
5 byte[] barcodeBytes = barcode.renderBarcodeToBytes();
6 Graphics2D g = ...
7 Rectangle2D rectangle = ...
8 barcode.renderBarcode(g, rectangle);
9 OutputStream outputStream = ...
10 barcode.renderBarcode(outputStream);
Generate PDF-417 barcodes in Java class
1 PDF417 barcode = new PDF417();
2 barcode.setData("PDF 417");
// add more PDF417 property settings here
3 barcode.renderBarcode("c:/barcode.gif");
4 BufferedImage bufferedImage = barcode.renderBarcode();
5 byte[] barcodeBytes = barcode.renderBarcodeToBytes();
6 Graphics2D g = ...
7 Rectangle2D rectangle = ...
8 barcode.renderBarcode(g, rectangle);
9 OutputStream outputStream = ...
10 barcode.renderBarcode(outputStream);
Generate QR-Code barcodes in Java class
1 QRCode barcode = new QRCode();
2 barcode.setData("123456789");
// add more QRCode property settings here
3 barcode.renderBarcode("c:/barcode.gif");
4 BufferedImage bufferedImage = barcode.renderBarcode();
5 byte[] barcodeBytes = barcode.renderBarcodeToBytes();
6 Graphics2D g = ...
7 Rectangle2D rectangle = ...
8 barcode.renderBarcode(g, rectangle);
9 OutputStream outputStream = ...
10 barcode.renderBarcode(outputStream);
How to Generate Barcode Image in Web Applications?There are two ways to create barcode images in your Java web applications.
How to Generate Barcode Images in JasperReports, iReport & Eclipse BIRT?
Barcode for Java Each Barcode Symbology Property Settings
1D (Linear) Barcode Types/Symbologies
2D (Matrix) Barcode Types/Symbologies Java Barcode Generator SupportSend your questions to support@barcodelib.com
|
||||||||||||