PHPackages                             aspose/barcode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. aspose/barcode

ActiveLibrary[Image &amp; Media](/categories/media)

aspose/barcode
==============

Aspose.BarCode for PHP via Java is a robust barcode generation and recognition component.

26.3(2mo ago)13.5k↑383.3%proprietaryPHPPHP &gt;=7.4

Since Jul 8Pushed 2mo ago7 watchersCompare

[ Source](https://github.com/aspose-barcode/Aspose.BarCode-for-PHP-via-Java)[ Packagist](https://packagist.org/packages/aspose/barcode)[ Docs](https://products.aspose.com/barcode/php-java/)[ RSS](/packages/aspose-barcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (83)Used By (0)

Barcode Generation &amp; Recognition via PHP
============================================

[](#barcode-generation--recognition-via-php)

Aspose.BarCode for PHP via Java is a robust and reliable barcode generation and recognition component, written in PHP and Java. It allows developers to quickly and easily add barcode creation and scanning functionality to their PHP applications.

General Barcode Features
------------------------

[](#general-barcode-features)

- Supports most established barcode standards and barcode specifications.
- Ability to read &amp; export barcodes in multiple image formats including BMP, GIF, JPEG &amp; PNG.
- Provides full control over barcode images including background color, bar color, image quality, rotation angle, x-dimension, resolution and more.
- Complete control over barcode captions including caption font, back color, fore color, alignment, and location.
- Support for checksum.
- Support for X-dimension &amp; Y-dimension for 2D BarCodes.
- Support for Wide to Narrow Ratio for supported symbologies.
- Support for DataMatrix barcode with X12, EDIFACT &amp; Base 256 encoding.

Barcode Recognition Features
----------------------------

[](#barcode-recognition-features)

- Can read most common 1D, 2D barcodes anywhere at any angle from an image.
- Specify an area in the image to scan the barcode
- Get region information for the barcodes recognized in the image

Barcode Imaging Features
------------------------

[](#barcode-imaging-features)

- Manipulate the barcodes image borders, border color, style, margins, width, etc.
- Rotate barcode images to any degree.
- Set anti-aliasing for barcode images.
- Manage barcode image margins.
- Customize image resolution.
- Set size in inches or millimeters.
- Auto size barcode images.

Barcode Symbologies
-------------------

[](#barcode-symbologies)

**Numeric Only:** EAN13, EAN8, UPCA, UPCE, ISBN, ISMN, ISSN, Interleaved2of5, Standard2of5, MSI, Code11, Codabar, Postnet, Planet, EAN14(SCC14), SSCC18, ITF14, IATA 2 of 5, DatabarOmniDirectional, DatabarStackedOmniDirectional, DatabarExpandedStacked, DatabarStacked, DatabarLimited, DatabarTruncated
**Alpha-Numeric:** GS1Code128, Code128, Code39 Extended, Code39 Standard, Code93 Extended, Code93 Standard, Australia Post, Italian Post 25, Matrix 2 of 5, DatabarExpanded, PatchCode
**2D Symbologies:** PDF417, DataMatrix, Aztec, QR, MicroQR, GS1DataMatrix, Code16K, CompactPDF417, Swiss QR (QR Bill)

Read Barcodes From
------------------

[](#read-barcodes-from)

**Images:** BMP, GIF, JPEG, PNG, TIFF, TIFF\_IN\_CMYK, EMF, SVG, PDF

Export Barcode Labels As Images
-------------------------------

[](#export-barcode-labels-as-images)

**Images:** BMP, GIF, JPEG, PNG, TIFF, TIFF\_IN\_CMYK, EMF, SVG, PDF

Get Started with Aspose.BarCode for PHP via Java
------------------------------------------------

[](#get-started-with-asposebarcode-for-php-via-java)

Aspose.BarCode for PHP via Java is distributed uses a background Java server (via Apache Thrift) to bridge PHP and Java functionality.

#### Requirements

[](#requirements)

-Java 1.8 or higher -PHP 7.4 or higher -Composer

#### Installation Steps

[](#installation-steps)

1. Install the package via Composer:

    ```
    composer require aspose/barcode
    ```
2. In the root of the package, locate and run the `start_server.cmd` file to start the background Thrift server:

    ```
    start_server.cmd
    ```

    You can also embed a similar script into your own project:

    **Windows:**

    ```
    @echo off
    :: Get the directory where this script is located
    set SCRIPT_DIR=%~dp0

    :: Define the path to the JAR file relative to this script
    set JAR_PATH=%SCRIPT_DIR%vendor\aspose\barcode-php\lib\aspose-barcode-php-thrift-25.5.jar

    :: Define the log file path (optional)
    set LOG_FILE=%SCRIPT_DIR%server.log

    echo Starting Thrift server...
    start /B java -jar "%JAR_PATH%"
    echo Thrift server started! Logs are in %LOG_FILE%.
    exit
    ```

    **Linux and macOS:**

    ```
    #!/bin/bash

    # Get the directory where this script is located
    SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

    # Define the path to the JAR file relative to this script
    JAR_PATH="$SCRIPT_DIR/vendor/aspose/barcode-php/lib/aspose-barcode-php-thrift-25.5.jar"

    # Define the log file path (optional)
    LOG_FILE="$SCRIPT_DIR/server.log"

    echo "Starting Thrift server..."
    nohup java -jar "$JAR_PATH" > "$LOG_FILE" 2>&1 &
    echo "Thrift server started! Logs are in $LOG_FILE."
    ```

    This script launches a Java process using the JAR file:
    `vendor/aspose/barcode-php/lib/aspose-barcode-php-thrift-25.5.jar`
    Make sure the server is running by checking the console output or verifying that **port 9090** is open (e.g., using `netstat`).
3. Once the Thrift server is running, your PHP application can interact with the Java-based barcode engine
    using the public API classes defined in the `Aspose\Barcode` namespace.
    These classes act as **PHP client wrappers**, communicating with the backend over Apache Thrift.
    You can use them to generate and recognize barcodes by simply calling methods as if they were native PHP objects, while the actual processing is performed on the Java side.

#### Sample code snippet for barcode recognition:

[](#sample-code-snippet-for-barcode-recognition)

The example below shows how to initialize the barcode reader, apply a license, set checksum validation, and read barcodes from a sample image:

```
public function barcodeReaderExample()
{

    $license = new License();
    $license->setLicense(TestsAssist::PHP_LICENSE_PATH);
    $image_path = TestsAssist::TESTDATA_ROOT . "Recognition/1D/Code39/code39.gif";
    $reader = new BarCodeReader($image_path, null, null);
    $reader->getBarcodeSettings()->setChecksumValidation(ChecksumValidation::ON);
    $foundBarCodes = $reader->readBarCodes();
    $foundCount = $reader->getFoundCount();
    print("Count of found barcodes: ". $foundCount.PHP_EOL);
    print("CodeText " . $foundBarCodes[0]->getCodeText().PHP_EOL);
    print("CodeType " . $foundBarCodes[0]->getCodeType().PHP_EOL);
    print("CodeType " . $foundBarCodes[0]->getCodeTypeName().PHP_EOL);
}
```

#### Sample code snippet for barcode reading and generation:

[](#sample-code-snippet-for-barcode-reading-and-generation)

The example below shows how to initialize the barcode generator, apply a license, generate barcode and read barcode:

```
public function readAndGenerateExample()
{
    $license = new License();
    $license->setLicense(TestsAssist::PHP_LICENSE_PATH);
    $codeText = "12345678";
    $encodeType = EncodeTypes::CODE_11;
    $generator = new BarcodeGenerator($encodeType, $codeText);
    $base64Image = $generator->generateBarCodeImage(BarCodeImageFormat::PNG);
    $reader = new BarCodeReader($base64Image, null, null);
    $resultsArray = $reader->readBarCodes();
    $barCodeResult = $resultsArray[0];
    $codeText = $barCodeResult->getCodeText();
    $codeType = $barCodeResult->getCodeTypeName();
    print("codeText " . $codeText);
    print("codeType " . $codeType);
}
```

Comprehensive instructions can be found in the [official documentation](https://docs.aspose.com/barcode/phpjava/).

[Product](https://products.aspose.com/barcode) | [Documentation](https://products.aspose.com/barcode/php-java) | [Blog](https://blog.aspose.com/category/barcode/) | [API Reference](https://apireference.aspose.com/barcode/java) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/barcode) | [Temporary License](https://purchase.aspose.com/temporary-license)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 86.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~19 days

Total

80

Last Release

61d ago

Major Versions

21.12.0 → 22.1.02022-01-22

22.12.1 → 23.1.02023-01-13

23.12.0 → 24.2.02024-01-29

24.12.0 → 25.1.02025-01-30

25.12.2 → 26.12026-01-30

PHP version history (3 changes)20.6.0PHP &gt;=7.0

20.9.3PHP &gt;=7.1

25.5.5PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32087729?v=4)[AsposeCloud](/maintainers/AsposeCloud)[@asposecloud](https://github.com/asposecloud)

![](https://avatars.githubusercontent.com/u/4221549?v=4)[Aspose](/maintainers/aspose)[@Aspose](https://github.com/Aspose)

---

Top Contributors

[![alex-grinin](https://avatars.githubusercontent.com/u/11834385?v=4)](https://github.com/alex-grinin "alex-grinin (75 commits)")[![valeriy-ten-aspose](https://avatars.githubusercontent.com/u/69453222?v=4)](https://github.com/valeriy-ten-aspose "valeriy-ten-aspose (7 commits)")[![farooqsheikhpk](https://avatars.githubusercontent.com/u/1773119?v=4)](https://github.com/farooqsheikhpk "farooqsheikhpk (1 commits)")[![Muzammil-khan](https://avatars.githubusercontent.com/u/42959707?v=4)](https://github.com/Muzammil-khan "Muzammil-khan (1 commits)")[![ValeriyTen](https://avatars.githubusercontent.com/u/26410032?v=4)](https://github.com/ValeriyTen "ValeriyTen (1 commits)")[![marechal-ferrant](https://avatars.githubusercontent.com/u/34920405?v=4)](https://github.com/marechal-ferrant "marechal-ferrant (1 commits)")[![babar-raza](https://avatars.githubusercontent.com/u/1225645?v=4)](https://github.com/babar-raza "babar-raza (1 commits)")

---

Tags

phpgeneratorbarcodeasposerecognitionjava

### Embed Badge

![Health badge](/badges/aspose-barcode/health.svg)

```
[![Health](https://phpackages.com/badges/aspose-barcode/health.svg)](https://phpackages.com/packages/aspose-barcode)
```

###  Alternatives

[picqer/php-barcode-generator

An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.

1.8k25.5M88](/packages/picqer-php-barcode-generator)[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4869.0k](/packages/jkphl-iconizr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
