PNG JPG BMP TIFF SVG
Aspose.BarCode  for Java
ITF

Generate ITF Labels with Java

Create Interleaved 2-of-5 (ITF) barcode in Java using server-side Aspose.BarCode for Java API.

How to Generate Interleaved 2-of-5 (ITF) barcode Using Java

To generate Interleaved 2-of-5 (ITF) barcode, get Aspose.BarCode for Java API, a rich, powerful, and easy-to-use barcode API for Java-based platforms. Download the latest version directly from Maven and then install it within your Maven-based project by adding the following configurations to pom.xml:

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-barcode</artifactId>
    <version>version of aspose-barcode API</version>
    <classifier>jdk17</classifier>
</dependency>

Steps to Generate Interleaved 2-of-5 (ITF) barcode in Java

Aspose.BarCode makes it easy for developers to create Interleaved 2-of-5 (ITF) barcode images with few lines of code.

  • Create a new object of BarCodeGenerator class
  • Define Interleaved 2-of-5 (ITF) barcode and other required barcode types as the EncodeTypes parameter
  • Specify input text using the setCodeText method
  • Use the BarCodeGenerator.save method to save the generated barcode image

System Requirements

Aspose barcode APIs are supported by all major platforms and operating systems. Before executing the code sample below, please check that you have the following prerequisites enabled in your system.

  • Microsoft Windows, Linux, or any OS compatible with the Java Runtime Environment for JSP/JSF and desktop applications
  • Java development environment, such as JRE 1.6 or above
  • Java Development version JSE2 7.0 or above

Code to be executed - Java


// Create an instane of the BarcodeGenerator class
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.ITF);

// Specify the code text
generator.setCodeText("");

// Specify the X-dimension 
// the smallest width of the unit of BarCode bars or spaces
generator.getParameters().getBarcode().getXDimension().setMillimeters(2);

// Set codetext position
generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.Below);

// Generate image
generator.generateBarCodeImage();
×
Generated barcode image