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

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

atheon/barcode-bundle
=====================

provide barcode rendering service into your Symfony application.

1.0.0(3y ago)019LGPL-3.0-or-laterPHPPHP ^5.5 || ^5.6 || ^7.0 || ^8.0

Since Oct 25Pushed 3y agoCompare

[ Source](https://github.com/Atheon/BGBarcodeBundle)[ Packagist](https://packagist.org/packages/atheon/barcode-bundle)[ Docs](https://github.com/paterik/BGBarcodeBundle)[ RSS](/packages/atheon-barcode-bundle/feed)WikiDiscussions master Synced 1mo ago

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

Introduction
============

[](#introduction)

This Bundle provide barcode rendering using our barcode generator base library supports ImageMagick/GDLib based image rendering, svg and html table drawn output of the following 1D/2D bar codes:

1d barcodes
-----------

[](#1d-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 Extention
- EAN5 : 5-Digits UPC-Based Extention
- 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: Intelligent Mail Barcode - Onecode - USPS-B-3200
- CODABAR : CODABAR
- CODE11 : CODE 11
- PHARMA : PHARMACODE
- PHARMA2T : PHARMACODE TWO-TRACKS

2d barcodes
-----------

[](#2d-barcodes)

- DATAMATRIX : Datamatrix (ISO/IEC 16022)
- PDF417 : PDF417 (ISO/IEC 15438:2006) / a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6
- QRCODE : QRcode Low error correction
- QRCODE, L : QRcode Low error correction
- QRCODE, M : QRcode Medium error correction
- QRCODE, Q : QRcode Better error correction
- QRCODE, H : QR-CODE Best error correction
- QR, RAW : raw mode - comma-separad list of array rows
- QR, RAW2 : raw mode - array rows are surrounded by square parenthesis.

Prerequisites
=============

[](#prerequisites)

This version requires Symfony 2.1

Installation
============

[](#installation)

1 - Add the following lines in your composer.json:

*for latest symfony 3.n kernel / framework environment:*

```
    "require": {
        "bitgrave/barcode-bundle": "^1.0"
    }

```

\_legacy symfony 2.1.n kernel? user version prior 1.0.0:

```
    "require": {
        "bitgrave/barcode-bundle": "0.0.9"
    }

```

2 - Run the composer to download the bundle

```
    $ php composer.phar update bitgrave/barcode-bundle

```

3 - Add this bundle to your application's kernel:

```
      // app/AppKernel.php
      public function registerBundles()
      {
          return array(
              // ...
              new BG\BarcodeBundle\BarcodeBundle(),
              // ...
          );
      }

```

Usage
=====

[](#usage)

1 - Add the following lines in your controller if you want to use both code types (1d/2d) :

```
use BG\BarcodeBundle\Util\Base1DBarcode as barCode;
use BG\BarcodeBundle\Util\Base2DBarcode as matrixCode;

```

2 - set the cache path (for image based barcode rendering) call the image- or html renderer including your code and barcode type :

```
 $myBarcode = new barCode();
 $myBarcode->savePath = '/my/temp/media/path';
 $bcPathAbs = $myBarcode->getBarcodePNGPath('501234567890', 'EAN13', 1.75, 45);
 $bcHTMLRaw = $myBarcode->getBarcodeHTML('501234567890', 'EAN13', 1.75, 45);

```

3 - fetch image by parse $bcPathAbs (absolute path to rendered barcode image) or using this a simple helper method

```
 /**
  * simple cache path returning method (sample cache path: "upload/barcode/cache" )
  *
  * @param bool $public
  *
  * @return string
  *
  */
 protected function getBarcodeCachePath($public = false)
 {

     return (!$public) ? $this->get('kernel')->getRootDir(). '/../web/upload/barcode/cache' : '/upload/barcode/cache';
 }

```

4 - send public path to your symfony view and put result into your image src path or just render out the alternative table based barcode html structure

```
 $this->render('AcmeDemoBundle:Demo:barcode.html.twig', array(
     'barcodePathAndFile' => $this->getBarcodeCachePath($bcPathAbs),
     'barcodeHTML' => $bcHTMLRaw,
 ));

 // AcmeDemoBundle:Demo:barcode.html.twig
 // ...

 // ...

 {{ barcodeHTML|raw }}
 // ...

```

How To Contribute
=================

[](#how-to-contribute)

To contribute changes, fixes, additions/features please open a pull request with your new code. please take not, that if you add new features or modify existing ones you have to doc this in projects README file (also update projects CHANGELOG file!)

License
=======

[](#license)

See: resources/meta/LICENSE

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.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

Unknown

Total

1

Last Release

1301d ago

### Community

Maintainers

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

---

Top Contributors

[![paterik](https://avatars.githubusercontent.com/u/2572857?v=4)](https://github.com/paterik "paterik (24 commits)")[![meron1122](https://avatars.githubusercontent.com/u/2895090?v=4)](https://github.com/meron1122 "meron1122 (3 commits)")[![Atheon](https://avatars.githubusercontent.com/u/767987?v=4)](https://github.com/Atheon "Atheon (2 commits)")[![rabauss](https://avatars.githubusercontent.com/u/14016098?v=4)](https://github.com/rabauss "rabauss (2 commits)")[![zittix](https://avatars.githubusercontent.com/u/818748?v=4)](https://github.com/zittix "zittix (2 commits)")[![benjaminlong](https://avatars.githubusercontent.com/u/913526?v=4)](https://github.com/benjaminlong "benjaminlong (1 commits)")[![zes-richard](https://avatars.githubusercontent.com/u/70267672?v=4)](https://github.com/zes-richard "zes-richard (1 commits)")[![mfuehrer](https://avatars.githubusercontent.com/u/5175375?v=4)](https://github.com/mfuehrer "mfuehrer (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")

---

Tags

qrcodedatamatrixpdf417barcodesbarcodeean

### Embed Badge

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

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

###  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/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k101.8M473](/packages/tecnickcom-tcpdf)[bitgrave/barcode-bundle

provide barcode rendering service into your Symfony2 application.

25444.0k1](/packages/bitgrave-barcode-bundle)[tecnickcom/tc-lib-barcode

PHP library to generate linear and bidimensional barcodes

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

PHPackages © 2026

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