PHPackages                             tecnickcom/tc-lib-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. tecnickcom/tc-lib-barcode

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

tecnickcom/tc-lib-barcode
=========================

PHP library to generate linear and bidimensional barcodes

2.4.27(2mo ago)2957.1M—3%9120LGPL-3.0-or-laterPHPPHP &gt;=8.1CI passing

Since Apr 6Pushed 2mo ago19 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-barcode)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[ Docs](http://www.tecnick.com)[ Fund](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)[ RSS](/packages/tecnickcom-tc-lib-barcode/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (142)Used By (20)

tc-lib-barcode
==============

[](#tc-lib-barcode)

*PHP barcode library*

[![Latest Stable Version](https://camo.githubusercontent.com/c3c4c11f296f868d519296cf5cce4fe30688b0a3c4165af5b93ed3200aa9e5b4/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[![Build](https://github.com/tecnickcom/tc-lib-barcode/actions/workflows/check.yml/badge.svg)](https://github.com/tecnickcom/tc-lib-barcode/actions/workflows/check.yml/badge.svg)[![Coverage](https://camo.githubusercontent.com/d57f9df11369582fdf79106c29446ff898a7aae6b6bfdc5cb97933356f41d170/68747470733a2f2f636f6465636f762e696f2f67682f7465636e69636b636f6d2f74632d6c69622d626172636f64652f67726170682f62616467652e7376673f746f6b656e3d50573672393769567557)](https://codecov.io/gh/tecnickcom/tc-lib-barcode)[![License](https://camo.githubusercontent.com/fe8d535cbdfb3b493a26bcd7fe81c6fa8968904dcd08d9bace460c977e7dcd0f/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)[![Downloads](https://camo.githubusercontent.com/23b118124e7a6b544a9c41a49a4fe185d6c49581e0140e11895c01909f25488f/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d626172636f64652f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-barcode)

[![Donate via PayPal](https://camo.githubusercontent.com/e5f561f4f549822da3fbfb75d0be9059a60eac15b1ff7af66500ca1dd4dba91b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d3837636565622e737667)](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)*

- **category** Library
- **package** \\Com\\Tecnick\\Barcode
- **author** Nicola Asuni
- **copyright** 2001-2026 Nicola Asuni - Tecnick.com LTD
- **license**  GNU-LGPL v3 (see LICENSE.TXT)
- **link**
- **SRC DOC**

Description
-----------

[](#description)

This library includes utility PHP classes to generate linear and bidimensional barcodes:

- C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9
- C39+ : CODE 39 with checksum
- C39E : CODE 39 EXTENDED
- C39E+ : CODE 39 EXTENDED + CHECKSUM
- C93 : CODE 93 - USS-93
- S25 : Standard 2 of 5
- S25+ : Standard 2 of 5 + CHECKSUM
- I25 : Interleaved 2 of 5
- I25+ : Interleaved 2 of 5 + CHECKSUM
- C128 : CODE 128
- C128A : CODE 128 A
- C128B : CODE 128 B
- C128C : CODE 128 C
- EAN2 : 2-Digits UPC-Based Extension
- EAN5 : 5-Digits UPC-Based Extension
- EAN8 : EAN 8
- EAN13 : EAN 13
- UPCA : UPC-A
- UPCE : UPC-E
- MSI : MSI (Variation of Plessey code)
- MSI+ : MSI + CHECKSUM (modulo 11)
- POSTNET : POSTNET
- PLANET : PLANET
- RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
- KIX : KIX (Klant index - Customer index)
- IMB : IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
- IMBPRE : IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200- pre-processed
- CODABAR : CODABAR
- CODE11 : CODE 11
- PHARMA : PHARMACODE
- PHARMA2T : PHARMACODE TWO-TRACKS
- AZTEC : AZTEC Code (ISO/IEC 24778:2008)
- DATAMATRIX : DATAMATRIX (ISO/IEC 16022)
- PDF417 : PDF417 (ISO/IEC 15438:2006)
- QRCODE : QR-CODE
- RAW : 2D RAW MODE comma-separated rows
- RAW2 : 2D RAW MODE rows enclosed in square parentheses

### Output Formats

[](#output-formats)

- PNG Image
- SVG Image
- HTML DIV
- Unicode String
- Binary String

The initial source code has been derived from [TCPDF](http://www.tcpdf.org).

Getting started
---------------

[](#getting-started)

First, you need to install all development dependencies using [Composer](https://getcomposer.org/):

```
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
```

This project include a Makefile that allows you to test and build the project with simple commands. To see all available options:

```
make help
```

To install all the development dependencies:

```
make deps
```

Running all tests
-----------------

[](#running-all-tests)

Before committing the code, please check if it passes all tests using

```
make qa
```

All artifacts are generated in the target directory.

Examples
--------

[](#examples)

Examples are located in the `example` directory.

Start a development server (requires PHP 8.0+) using the command:

```
make server

```

and point your browser to

### Simple Code Example

[](#simple-code-example)

Please check example/index.php for a full example.

```
// instantiate the barcode class
$barcode = new \Com\Tecnick\Barcode\Barcode();

// generate a barcode
$bobj = $barcode->getBarcodeObj(
    'QRCODE,H',                     // barcode type and additional comma-separated parameters
    'https://tecnick.com',          // data string to encode
    -4,                             // bar width (use absolute or negative value as multiplication factor)
    -4,                             // bar height (use absolute or negative value as multiplication factor)
    'black',                        // foreground color
    array(-2, -2, -2, -2)           // padding (use absolute or negative values as multiplication factors)
    )->setBackgroundColor('white'); // background color

// output the barcode as HTML div (see other output formats in the documentation and examples)
echo $bobj->getHtmlDiv();

```

Installation
------------

[](#installation)

Create a composer.json in your projects root-directory:

```
{
    "require": {
        "tecnickcom/tc-lib-barcode": "^2.3"
    }
}
```

Or add to an existing project with:

```
composer require tecnickcom/tc-lib-barcode ^2.3
```

Packaging
---------

[](#packaging)

This library is mainly intended to be used and included in other PHP projects using Composer. However, since some production environments dictates the installation of any application as RPM or DEB packages, this library includes make targets for building these packages (`make rpm` and `make deb`). The packages are generated under the `target` directory.

When this library is installed using an RPM or DEB package, you can use it your code by including the autoloader:

```
require_once ('/usr/share/php/Com/Tecnick/Barcode/autoload.php');
```

Developer(s) Contact
--------------------

[](#developers-contact)

\*2026 Nicola Asuni

###  Health Score

74

—

ExcellentBetter than 100% of packages

Maintenance85

Actively maintained with recent releases

Popularity65

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.9% 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 ~28 days

Recently: every ~6 days

Total

141

Last Release

80d ago

Major Versions

1.18.4 → 2.0.72023-11-22

PHP version history (6 changes)1.0.0PHP &gt;=5.3.3

1.7.0PHP &gt;=5.4

1.15.11PHP &gt;=5.3

1.18.0PHP &gt;=5.6

2.0.7PHP &gt;=8.0

2.4.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8ee10615840cb28715139809c13ec322d1ccd902506b090469702e5b9d7b88e?d=identicon)[nicolaasuni](/maintainers/nicolaasuni)

---

Top Contributors

[![nicolaasuni](https://avatars.githubusercontent.com/u/1186996?v=4)](https://github.com/nicolaasuni "nicolaasuni (284 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (3 commits)")[![Xclynaj](https://avatars.githubusercontent.com/u/75911906?v=4)](https://github.com/Xclynaj "Xclynaj (2 commits)")[![kristof-ringleff](https://avatars.githubusercontent.com/u/47804013?v=4)](https://github.com/kristof-ringleff "kristof-ringleff (1 commits)")[![maff](https://avatars.githubusercontent.com/u/27403?v=4)](https://github.com/maff "maff (1 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (1 commits)")[![Caffe1neAdd1ct](https://avatars.githubusercontent.com/u/1327332?v=4)](https://github.com/Caffe1neAdd1ct "Caffe1neAdd1ct (1 commits)")[![ulrich-berkmueller](https://avatars.githubusercontent.com/u/709350?v=4)](https://github.com/ulrich-berkmueller "ulrich-berkmueller (1 commits)")[![valioDOTch](https://avatars.githubusercontent.com/u/800467?v=4)](https://github.com/valioDOTch "valioDOTch (1 commits)")[![alex-bukach](https://avatars.githubusercontent.com/u/2883497?v=4)](https://github.com/alex-bukach "alex-bukach (1 commits)")

---

Tags

aztecbarcodec128c93codabarcode11datamatrixean13imbimbprekixmsipharmacodephpplanetpostnetqrcoderms4ccupcaupceqr codedatamatrixpdf417barcodeCODABARupcStandard 2 of 5MSIPOSTNETKIXCBCplanetCODE 39aztecroyal mailtc-lib-barcodeANSI MH10.8M-1983USD-33 of 9CODE 93USS-93Interleaved 2 of 5EAN 8EAN 13UPC-AUPC-ERMS4CCKlantIntelligent Mail BarcodeOnecodeUSPS-B-3200CODE 11PHARMACODEPHARMACODE TWO-TRACKSECC200CODE 128 A B CISO IEC 15438 2006ISO IEC 16022ISO IEC 24778 2008

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tecnickcom-tc-lib-barcode/health.svg)

```
[![Health](https://phpackages.com/badges/tecnickcom-tc-lib-barcode/health.svg)](https://phpackages.com/packages/tecnickcom-tc-lib-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)[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[barcode-bakery/barcode-1d

Generates 1D barcodes from a PHP server to a file or HTML document.

10146.1k1](/packages/barcode-bakery-barcode-1d)

PHPackages © 2026

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