PHPackages                             jarekpaprocki/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jarekpaprocki/barcode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

v5.3.9(8y ago)047LGPL-3.0PHPPHP &gt;=5.6.0

Since Feb 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jarekpaprocki/barcode)[ Packagist](https://packagist.org/packages/jarekpaprocki/barcode)[ RSS](/packages/jarekpaprocki-barcode/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (29)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 5.2, 5.3 and 5.4
========================================================

[](#this-package-is-compatible-with-laravel-52-53-and-54)

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": "^5.3"
}

```

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.

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

31

↑

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 70.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 ~44 days

Recently: every ~81 days

Total

26

Last Release

2981d ago

Major Versions

1.0.1 → 2.0.02015-12-22

1.0.2 → 4.22016-01-13

4.2.2 → 5.1.02016-01-13

4.2.3 → 5.3.02016-10-18

4.2.4 → 5.1.12017-03-04

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

4.2PHP &gt;=5.3.0

5.3.6PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/40194004d9f2fb94a4df9c147de514d5f6b1c0e5f819e7e2570503f3557c5bfd?d=identicon)[jarekpaprocki](/maintainers/jarekpaprocki)

---

Top Contributors

[![milon](https://avatars.githubusercontent.com/u/1138769?v=4)](https://github.com/milon "milon (40 commits)")[![maosalah](https://avatars.githubusercontent.com/u/2687734?v=4)](https://github.com/maosalah "maosalah (3 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)")[![Ank91](https://avatars.githubusercontent.com/u/98448051?v=4)](https://github.com/Ank91 "Ank91 (2 commits)")[![jarekpaprocki](https://avatars.githubusercontent.com/u/9371296?v=4)](https://github.com/jarekpaprocki "jarekpaprocki (2 commits)")[![spidfire](https://avatars.githubusercontent.com/u/156694?v=4)](https://github.com/spidfire "spidfire (1 commits)")[![cyberhicham](https://avatars.githubusercontent.com/u/10002527?v=4)](https://github.com/cyberhicham "cyberhicham (1 commits)")[![eduavila](https://avatars.githubusercontent.com/u/1779843?v=4)](https://github.com/eduavila "eduavila (1 commits)")[![gduymaz](https://avatars.githubusercontent.com/u/8122090?v=4)](https://github.com/gduymaz "gduymaz (1 commits)")[![RobLui](https://avatars.githubusercontent.com/u/10846766?v=4)](https://github.com/RobLui "RobLui (1 commits)")[![alex-alvarado](https://avatars.githubusercontent.com/u/5059955?v=4)](https://github.com/alex-alvarado "alex-alvarado (1 commits)")

---

Tags

qr codeqrcodelaraveldatamatrixpdf417barcodeeanCODABARCODE 39CODE 128

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/jarekpaprocki-barcode/health.svg)](https://phpackages.com/packages/jarekpaprocki-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)[bitgrave/barcode-bundle

provide barcode rendering service into your Symfony2 application.

25444.0k1](/packages/bitgrave-barcode-bundle)[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)
