PNG JPG BMP TIFF SVG
Aspose.BarCode  for PHP via Java
ITF

Generate ITF Labels with PHP via Java

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

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

Generate customized Interleaved 2-of-5 (ITF) barcode barcodes within PHP applications by means of the Aspose.BarCode for PHP via Java, an efficient, scalable, and user-friendly barcode API intended for Java-based platforms. To launch the barcode library, download the latest version from the Aspose releases portal. Otherwise, get the aspose/barcode package from Packagist and then embed it into your PHP projects using composer:

Command

{    
    "require": {        
        "asposebarcode/aspose_barcode_java_for_php": "dev-master"    
    }
}

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

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

  • Create a new instance of BarCodeGenerator class
  • Specify Interleaved 2-of-5 (ITF) barcode and other relevant barcode types as the EncodeTypes parameter
  • Set barcode text as the second parameter
  • Specify image dimensions and location if needed
  • Call the BarCodeGenerator.save method to obtain the Interleaved 2-of-5 (ITF) barcode image in the required format

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 PHP developement environments
  • PHP/Java Bridge installed
  • FastCGI and Tomcat Server 8.0 or above

Code to be executed - PHP


// Create an instane of the BarcodeGenerator class
$generator = new BarcodeGenerator(EncodeTypes::ITF, "");

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

// Set codetext position
$generator->getParameters()->getCodeTextParameters()->setLocation(CodeLocation::Below);

// Generate and save image
$generator->save("example.png", BarCodeImageFormat::PNG);
×
Generated barcode image