PHPackages                             pittacusw/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. pittacusw/barcode

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

pittacusw/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)

9.1(4y ago)032LGPL-3.0PHPPHP ^7.3 | ^8.0

Since Feb 22Pushed 4y agoCompare

[ Source](https://github.com/PittacusW/barcode)[ Packagist](https://packagist.org/packages/pittacusw/barcode)[ Fund](https://paypal.me/tomilon)[ GitHub Sponsors](https://github.com/milon)[ RSS](/packages/pittacusw-barcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (39)Used By (0)

[![Packagist Downloads](https://camo.githubusercontent.com/380ee6ca65b291cc80c8d75844fd2fb5418b1caf544542a7cda870a4528fa2ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696c6f6e2f626172636f64652e737667)](https://packagist.org/packages/milon/barcode) [![Stable version](https://camo.githubusercontent.com/b723907232ce465c2b1f9b3f647b9870c11b47c54dbc170cfeb95eaa0a311e63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c6f6e2f626172636f64652e737667)](https://packagist.org/packages/milon/barcode) [![License](https://camo.githubusercontent.com/324fa92153a5afb935c7ec4c28ec9e04abda1c484ccd472be9feff044613e069/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d696c6f6e2f626172636f64652e737667)](https://packagist.org/packages/milon/barcode)

This is a barcode generation package inspired by . Actually, I use that package's underline classes for generating barcodes. This package is just a wrapper of that package and adds compatibility with Laravel 5.

I used the following classes of that package.

- src/Milon/Barcode/Datamatrix.php (include/barcodes/datamatrix.php)
- src/Milon/Barcode/DNS1D.php (tcpdf\_barcodes\_1d.php)
- src/Milon/Barcode/DNS2D.php (tcpdf\_barcodes\_2d.php)
- src/Milon/Barcode/PDF417.php (include/barcodes/pdf417.php)
- src/Milon/Barcode/QRcode.php (include/barcodes/qrcode.php)

[Read More on TCPDF website](http://www.tcpdf.org)

This package is compatible with Laravel `4.*` , `5.*`, `6.*`, `7.*` and `8.*`
=============================================================================

[](#this-package-is-compatible-with-laravel-4--5-6-7-and-8)

This package relies on [php-gd](http://php.net/manual/en/book.image.php) extension. So, make sure it is installed on your machine.

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

[](#installation)

Begin by installing this package through Composer. Just run following command to terminal-

```
composer require milon/barcode
```

You can also edit your project's `composer.json` file to require `milon/barcode`.

```
"require": {
    "milon/barcode": "^8.0"
}
```

For Laravel 7.\* use this-

```
"require": {
    "milon/barcode": "^7.0"
}
```

For Laravel 6.\* use this-

```
"require": {
    "milon/barcode": "^6.0"
}
```

For Laravel 5.0 and 5.1 use this-

```
"require": {
    "milon/barcode": "^5.1"
}
```

For Laravel 4.0, 4.1 and 4.2 use this-

```
"require": {
    "milon/barcode": "^4.2"
}
```

Next, update Composer from the Terminal:

```
composer update
```

Once this operation completes, the final step is to add the service provider. Open `config/app.php`, and add a new item to the providers array.

```
'providers' => [
    // ...
    Milon\Barcode\BarcodeServiceProvider::class,
]
```

For version 4.\* add these lines on `app/config/app.php` file-

```
'providers' => array(
    // ...
    'Milon\Barcode\BarcodeServiceProvider',
)
```

If you want to change Bar-code's settings (Store Path etc.), you need to publish its config file(s). For that you need to run in the terminal-

```
# Laravel 5.x
php artisan vendor:publish

# Laravel 4.x
php artisan config:publish milon/barcode
```

Make sure you have write permission to the storage path. By default it sets to `/storage` folder.

Now add the alias.

```
'aliases' => [
    // ...
    'DNS1D' => Milon\Barcode\Facades\DNS1DFacade::class,
    'DNS2D' => Milon\Barcode\Facades\DNS2DFacade::class,
]
```

For version 4.2 alias will be like this-

```
'aliases' => array(
    // ...
    'DNS1D' => 'Milon\Barcode\Facades\DNS1DFacade',
    'DNS2D' => 'Milon\Barcode\Facades\DNS2DFacade',
)
```

Bar-code 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)

generator in html, png embedded base64 code and SVG canvas

```
echo DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T');
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T');
echo '';
echo DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T');
echo '';
```

```
echo DNS1D::getBarcodeSVG('4445645656', 'C39');
echo DNS2D::getBarcodeHTML('4445645656', 'QRCODE');
echo DNS2D::getBarcodePNGPath('4445645656', 'PDF417');
echo DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');
echo '';
```

Width and Height example
------------------------

[](#width-and-height-example)

```
echo DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33);
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33);
echo '';
echo DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33);
echo '';
```

Color
-----

[](#color)

```
echo DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33,'green');
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33,'green');
echo '';
echo DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0));
echo '';
```

Show Text
---------

[](#show-text)

```
echo DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33,'green', true);
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33,'green', true);
echo '';
echo DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0), true);
echo '';
```

2D Barcodes
-----------

[](#2d-barcodes)

```
echo DNS2D::getBarcodeHTML('4445645656', 'QRCODE');
echo DNS2D::getBarcodePNGPath('4445645656', 'PDF417');
echo DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');
```

1D Barcodes
-----------

[](#1d-barcodes)

```
echo DNS1D::getBarcodeHTML('4445645656', 'C39');
echo DNS1D::getBarcodeHTML('4445645656', 'C39+');
echo DNS1D::getBarcodeHTML('4445645656', 'C39E');
echo DNS1D::getBarcodeHTML('4445645656', 'C39E+');
echo DNS1D::getBarcodeHTML('4445645656', 'C93');
echo DNS1D::getBarcodeHTML('4445645656', 'S25');
echo DNS1D::getBarcodeHTML('4445645656', 'S25+');
echo DNS1D::getBarcodeHTML('4445645656', 'I25');
echo DNS1D::getBarcodeHTML('4445645656', 'I25+');
echo DNS1D::getBarcodeHTML('4445645656', 'C128');
echo DNS1D::getBarcodeHTML('4445645656', 'C128A');
echo DNS1D::getBarcodeHTML('4445645656', 'C128B');
echo DNS1D::getBarcodeHTML('4445645656', 'C128C');
echo DNS1D::getBarcodeHTML('44455656', 'EAN2');
echo DNS1D::getBarcodeHTML('4445656', 'EAN5');
echo DNS1D::getBarcodeHTML('4445', 'EAN8');
echo DNS1D::getBarcodeHTML('4445', 'EAN13');
echo DNS1D::getBarcodeHTML('4445645656', 'UPCA');
echo DNS1D::getBarcodeHTML('4445645656', 'UPCE');
echo DNS1D::getBarcodeHTML('4445645656', 'MSI');
echo DNS1D::getBarcodeHTML('4445645656', 'MSI+');
echo DNS1D::getBarcodeHTML('4445645656', 'POSTNET');
echo DNS1D::getBarcodeHTML('4445645656', 'PLANET');
echo DNS1D::getBarcodeHTML('4445645656', 'RMS4CC');
echo DNS1D::getBarcodeHTML('4445645656', 'KIX');
echo DNS1D::getBarcodeHTML('4445645656', 'IMB');
echo DNS1D::getBarcodeHTML('4445645656', 'CODABAR');
echo DNS1D::getBarcodeHTML('4445645656', 'CODE11');
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA');
echo DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T');
```

Running without Laravel
=======================

[](#running-without-laravel)

You can use this library without using Laravel.

Example:

```
use \Milon\Barcode\DNS1D;

$d = new DNS1D();
$d->setStorPath(__DIR__.'/cache/');
echo $d->getBarcodeHTML('9780691147727', 'EAN13');
```

License
-------

[](#license)

This package is published under `GNU LGPLv3` license and copyright to [Nuruzzaman Milon](http://milon.im). Original Barcode generation classes were written by Nicola Asuni. The license agreement is on project's root.

### [Buy me a coffee ☕](https://paypal.me/tomilon?locale.x=en_US)

[](#buy-me-a-coffee-)

License: GNU LGPLv3
Package Author: [Nuruzzaman Milon](http://milon.im)
Original Barcode Class Author: [Nicola Asuni](http://www.tcpdf.org)
Package Copyright: Nuruzzaman Milon
Barcode Generation Class Copyright:
Nicola Asuni
Tecnick.com LTD
[www.tecnick.com](http://www.tecnick.com)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 66.3% 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 ~75 days

Recently: every ~132 days

Total

35

Last Release

1554d ago

Major Versions

5.3.6 → 6.0.02019-09-09

6.0.2 → 7.0.02020-03-05

6.0.3 → 7.0.12020-08-26

6.0.4 → 8.0.02020-09-09

8.0.1 → 9.02022-02-12

PHP version history (5 changes)0.5PHP &gt;=5.4.0

4.2PHP &gt;=5.3.0

5.3.6PHP &gt;=5.6.0

8.0.0PHP ^7.3

8.0.1PHP ^7.3 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/97c33f4ec07e9426c6c66fe4d0b0840a31823e10992dcd1824bc91982d043ea3?d=identicon)[contal](/maintainers/contal)

---

Top Contributors

[![milon](https://avatars.githubusercontent.com/u/1138769?v=4)](https://github.com/milon "milon (69 commits)")[![maosalah](https://avatars.githubusercontent.com/u/2687734?v=4)](https://github.com/maosalah "maosalah (3 commits)")[![yoshkin](https://avatars.githubusercontent.com/u/4170784?v=4)](https://github.com/yoshkin "yoshkin (2 commits)")[![Ank91](https://avatars.githubusercontent.com/u/98448051?v=4)](https://github.com/Ank91 "Ank91 (2 commits)")[![junereycasuga](https://avatars.githubusercontent.com/u/1797584?v=4)](https://github.com/junereycasuga "junereycasuga (2 commits)")[![laszlokis-lynx](https://avatars.githubusercontent.com/u/258006090?v=4)](https://github.com/laszlokis-lynx "laszlokis-lynx (2 commits)")[![mix5003](https://avatars.githubusercontent.com/u/1129524?v=4)](https://github.com/mix5003 "mix5003 (2 commits)")[![PittacusW](https://avatars.githubusercontent.com/u/5810290?v=4)](https://github.com/PittacusW "PittacusW (2 commits)")[![SanderWind](https://avatars.githubusercontent.com/u/1670379?v=4)](https://github.com/SanderWind "SanderWind (2 commits)")[![squatto](https://avatars.githubusercontent.com/u/748444?v=4)](https://github.com/squatto "squatto (2 commits)")[![jerodev](https://avatars.githubusercontent.com/u/3493941?v=4)](https://github.com/jerodev "jerodev (1 commits)")[![sorelio](https://avatars.githubusercontent.com/u/75777120?v=4)](https://github.com/sorelio "sorelio (1 commits)")[![spidfire](https://avatars.githubusercontent.com/u/156694?v=4)](https://github.com/spidfire "spidfire (1 commits)")[![crishoj](https://avatars.githubusercontent.com/u/20393?v=4)](https://github.com/crishoj "crishoj (1 commits)")[![chrisrenga](https://avatars.githubusercontent.com/u/13778529?v=4)](https://github.com/chrisrenga "chrisrenga (1 commits)")[![alex-alvarado](https://avatars.githubusercontent.com/u/5059955?v=4)](https://github.com/alex-alvarado "alex-alvarado (1 commits)")[![neodisco](https://avatars.githubusercontent.com/u/15376698?v=4)](https://github.com/neodisco "neodisco (1 commits)")[![stillzombie](https://avatars.githubusercontent.com/u/4580799?v=4)](https://github.com/stillzombie "stillzombie (1 commits)")[![RobLui](https://avatars.githubusercontent.com/u/10846766?v=4)](https://github.com/RobLui "RobLui (1 commits)")[![yasserbelhimer](https://avatars.githubusercontent.com/u/56972095?v=4)](https://github.com/yasserbelhimer "yasserbelhimer (1 commits)")

---

Tags

qr codeqrcodelaraveldatamatrixpdf417barcodeeanCODABARCODE 39CODE 128

### Embed Badge

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

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

###  Alternatives

[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)[tecnickcom/tc-lib-barcode

PHP library to generate linear and bidimensional barcodes

2957.1M28](/packages/tecnickcom-tc-lib-barcode)[jucksearm/php-barcode

Barcode Generation Package inspired by Nicola Asuni.

12362.6k1](/packages/jucksearm-php-barcode)

PHPackages © 2026

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