Aspose.BarCode  for PHP via Java

PHP Barcode Generator and Reader API

Scan or Generate 1D, 2D and postal barcodes from images in any PHP web application.

  Download Free Trial
  
 

Aspose.BarCode for PHP via Java is a set of barcode generation and reading APIs for PHP applications and scripts. Developers can easily read 1D, 2D and postal barcodes from images at different angles. Barcode generator API creates barcode images within various formats such as JPG, PNG, GIF, BMP. Moreover, It supports multiple imaging features like manipulating borders, color, rotating images, customizing resolution and a lot more.

Advanced PHP Barcode API Features

Generate ECI QR Codes

Among various popular barcode types, the API can be used to create barcodes with special parameters. One of such functions allows developers to generate ECI QR codes that encode Unicode symbols using extended channel interpretation (ECI), a special communication protocol. It is a standard for encoding character sets in QR Codes. It allows QR Code readers to correctly interpret and display text in different languages and character sets, which may not be supported by the default QR Code character set. While scanning a QR code with an ECI designator, the reader can identify the correct character set to use for decoding and displaying the information encoded in this QR Code. This enables supporting a wide range of languages and character sets. This protocol is useful to create QR Codes encoding non-English characters, such as Japanese, Cyrillic, Hebrew, Greek, Arabic, and others. When ECI is enabled, a QR code not only stores a set of digits as raw byte values, but it also includes an explanation to interpret these values. The barcode library supports all most widely used charset encodings, such as UTF8, ASCII, and many others. Generate QR codes to encode non-English symbols using the ECI mode.

QR Code Generation

API has the capability to create barcodes of various types, including Data Matrix, Aztec Code, PDF417, and others, for large or non-standard input text values. Here is the code sample for QR Code generation.

Code to be executed - PHP


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

// 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);
Generation result

Barcode Reading Quality Presets

One of the features of Aspose.BarCode for PHP via Java is the ability to customize the barcode reading process by using different presets. These presets are pre-defined sets of reading parameters that are optimized for different scenarios and can help improve the accuracy and speed of barcode recognition. For example, some presets can be used to improve the recognition of small, low-quality, or damaged barcodes, as well as barcodes that are scanned from complex text documents or that are rotated at an angle. Other presets can be used to increase the reading speed for high-quality images and linear barcodes. Using these presets, developers can fine-tune the barcode reading process to maximize recognition accuracy and efficiency for their specific use cases. This can improve the overall performance of their applications and provide a better user experience for their customers.

Barcode Recognition Live Example

The barcode reader API provides a set of features for scanning, detecting, and reading 1D, 2D, and postal barcodes. With just a few lines of code, developers can easily integrate this functionality into their applications and use it to detect and decode a wide range of commonly used barcodes. The API is designed to be user-friendly and intuitive, making it easy for developers to quickly and easily add barcode scanning capabilities to their applications.

Ready to recognize Recognizing Drop a file here or click to browse *

* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.

Code to be executed - PHP

    
try
{
    $image_bytes = file_get_contents("<file name>");
    $image = base64_encode($image_bytes);
    $reader = new BarCodeReader($image, null, DecodeType::AllSupportedTypes);
    forEach($reader->readBarCodes() as $res)
    {
        print("Code Text : ".$res->getCodeTypeName()."\\n");
        print("\\n");
        print("Code Type : ".$res->getCodeText()."\\n");
    }

}
catch (BarcodeException $e)
{
    print($e->getMessage());
}

Recognition result

What People Are Saying

Don't just take our word for it. See what users have to say about APIs.

 
 
View Case Studies
  

Support and Learning Resources