Four types of royalty-free developer license with lifelong to use
Interleaved 2 of 5 Barcode Introduction
Interleaved 2 of 5 is also known as ANSI/AIM ITF 25, ANSI/AIM I-2/5, Uniform Symbology Specification ITF, USS ITF 2/5, ITF, I-2/5, 2 of 5 Interleaved, 2/5 Interleaved.
Compatibility: Barcode for Java library is compatible with the latest Interleaved 2 of 5 ISO specification [ISO/IEC 16390 (Second edition 2007-06-15)].
Interleaved 2 of 5 is a higher-density numeric symbology based upon the Standard 2 of 5 symbology. It is used primarily in the distribution and warehouse industry.
Interleaved 2 of 5 encodes any even number of numeric characters in the widths (either narrow or wide) of the bars and spaces of the bar code. Unlike Standard 2 of 5, which only encodes information in the width of the bars, Interleaved 2 of 5 encodes data in the width of both the bars and spaces. This allows Interleaved 2 of 5 to achieve a somewhat higher density.
The symbology is called "interleaved" because the first numeric data is encoded in the first 5 bars while the second numeric data is encoded in the first 5 spaces that separate the first 5 bars. Thus the first 5 bars and spaces actually encode two characters. This is also why the bar code can only encode an even number of data elements.
Sample of an Interleaved 2 of 5 Barcode
Interleaved 2 of 5 Encoding Data Scope
Interleaved 2 of 5 Barcode for Java supports:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
How to Generate Interleaved 2 of 5 Barcode in Java Class?
The following Java code illustrates how to create a Interleaved 2 of 5 barcode, and output to various formats.
1 Linear linear = new Linear(); 2 linear.setType(Linear.INTERLEAVED25); 3 linear.setData("0123456789012"); 4 linear.renderBarcode("c:/barcode.gif");
Under java_barcode_trial package, copy barcode folder to your java servlet container like tomcat.
Restart tomcat. Now you have installed successfully.
To test your installation, open your web browser and navigate to: http://YourDomain:Port/barcode/linear?Data=0123456789012&Type=INTERLEAVED25.
To create barcode image in your JSP or html page, you need pass the url to IMG tag src value. For example, <img src="http://YourDomain:Port/barcode/linear?Data=0123456789012&Type=INTERLEAVED25" /> Using this method, it will not generate any barcode images in your server side.
The second method is to generate barcode images in your server side.
Create a barcode image in server side, like Linear linear = new Linear(); linear.setData("0123456789012"); linear.setType(Linear.INTERLEAVED25); linear.renderBarcode("C:/Tools/Tomcat 5.5/webapps/YourWebApp/barcode-images/barcode.gif");
In your JSP or HTML page, you need use IMG tag to display generated image, like <img src="http://YourDomain:Port/YourWebApp/barcode-images/barcode.gif" />
How to Generate Barcode Interleaved 2 of 5 Image in Jasper Reports, iReport, Eclipse BIRT?
Set N property, Wide bar vs Narrow bar ratio. Valid values are from 2.0f to 3.0f, inclusive. Default is 2.0f. Servlet URL Parameter: N. Sample: &N=3.
Barcode image size settings.
Set property uom (Unit of Measure) for properties X, Y, leftMargin, rightMargin, topMargin and bottomMargin. Default is Linear.UOM_PIXEL (0). Valid values are Linear.UOM_PIXEL (0), Linear.UOM_CM (1), Linear.UOM_Inch (2). Servlet URL Parameter: "UOM". Value: 0 (pixel), 1 (cm), 2 (inch). Sample: &UOM=0
Set the X (for barcode module width) and Y (for barcode module height) properties. Both types are float. Default X is 3. Y is 75. Servlet URL Parameter: "X", "Y". Sample: &X=3&Y=75.
Set the leftMargin, rightMargin, topMargin and bottomMargin properties, and types are all float. Default values are 0 for all 4 margin settings. Servlet URL Parameter: "LeftMargin", "RightMargin", "TopMargin", "BottomMargin". Sample: &LeftMargin=0.
Set the resolution property (Value is expressed in DPI - Dots per inch). Default is 72 dpi. Servlet URL Parameter: "Resolution". Sample: &Resolution=72
Setting up text style in barcode image.
Set the showText properties. If this value is true, barcode data will be displayed with the barcode. Default is true. Servlet URL Parameter: "ShowText". Value: "t" (true), "f" (false). Sample: &ShowText=t.
Set the textFont property. The font used to display text in barcode image. Default is new Font("Arial", Font.PLAIN, 11). Servlet URL Parameter: "TextFont". Value format: [font name]|[font style]|[font size]. Sample Values: &TextFont=Arial|Bold|12
With rotate property, you can display barcode horizontally or vertically. Default value is 0. Servlet URL Parameter: "Rotate". Sample: &Rotate=0. Value can be:
0 (Linear.ANGLE_0),
1 (Linear.ANGLE_90),
2 (Linear.ANGLE_180),
3 (Linear.ANGLE_270).
How to Set Generated Interleaved 2 of 5 Barcode Image Size?