Java Code 2 of 5 Generator Library SDK Integration & Developer Guide
Generate barcode Code 2 of 5 images in Java class, Servlet, JSP, J2EE with complete sample Java source code
- Generate, create Code 2 of 5 in Java applications
- Easy to install & integrate barcode Code 2 of 5 generation library SDK into Java developments
- Generate over 30 linear, 2d barcode images in Java including
Java QR Code,
Java Data Matrix,
Java PDF-417,
Java EAN,
Java UPC,
Java Code 39
- Generate Code 2 of 5 images in Java class, Java Bean, Swing, Applet, J2SE
- Create barcode Code 2 of 5 in Java web application, including Servlet, JSP, EJB, Tomcat, JBoss, J2EE
- Create & Print Code 2 of 5 barcode in BIRT reports designer and BIRT report runtime
- Generate & Draw Code 2 of 5 in Jasper Reports, iReport
- Encode Code 2 of 5 images to jpeg, eps, gif, png, tiff, bitmap files in Java program
Index
Java Code 2 of 5 Generator Introduction
Code 2 of 5, also known as Standard 2 of 5, Industrial 2 of 5, is a low-density numeric symbology that has been widely used in warehouse, photo finishing and airline industries.
Generate and create Code 2 of 5 barcode using Java is one of the functions in OnBarcode's
Barcode for Java Generating Java library (jar file), which supports
generating & printing Code 2 of 5 and 20+ other linear & 2D bar codes in Java application and software.
Code 2 of 5 Generator and Reader library, SDK & application
Code 2 of 5 Generator components and software include
Code 2 of 5 in .NET,
Code 2 of 5 in C#,
Code 2 of 5 in VB.NET,
Code 2 of 5 in ASP.NET,
Code 2 of 5 Generator Software.
This document is providing a detailed Java sample source code about generating Code 2 of 5 barcodes in Java class using
Java Barcode generation component.
Complete Code 2 of 5 custmoization settings is included in
Java Code 2 of 5 generating guide.
Generate Code 2 of 5 Barcodes in Java
Generating Code 2 of 5 barcode in Java class example:
Code25 barcode = new Code25();
/*
Code 2 of 5 Valid data char set:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)
*/
barcode.setData("0123456789");
// Code 2 of 5 Wide Narrow bar Ratio
// Valid value is from 2.0 to 3.0 inclusive.
barcode.setN(3.0f);
// Unit of Measure, pixel, cm, or inch
barcode.setUom(IBarcode.UOM_PIXEL);
// barcode bar module width (X) in pixel
barcode.setX(3f);
// barcode bar module height (Y) in pixel
barcode.setY(75f);
// barcode image margins
barcode.setLeftMargin(0f);
barcode.setRightMargin(0f);
barcode.setTopMargin(0f);
barcode.setBottomMargin(0f);
// barcode image resolution in dpi
barcode.setResolution(72);
// disply barcode encoding data below the barcode
barcode.setShowText(true);
// barcode encoding data font style
barcode.setTextFont(new Font("Arial", 0, 12));
// space between barcode and barcode encoding data
barcode.setTextMargin(6);
// barcode displaying angle
barcode.setRotate(IBarcode.ROTATE_0);
barcode.drawBarcode("C:\\code2of5.gif");
Java Barcode Generation Demo Source Codes: