PHPackages                             kmalisiewicz/php-barcode-generator - 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. kmalisiewicz/php-barcode-generator

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

kmalisiewicz/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.

v0.2.1(9y ago)023LGPLv3PHPPHP &gt;=5.4.0

Since Aug 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kmalisiewicz/php-barcode-generator)[ Packagist](https://packagist.org/packages/kmalisiewicz/php-barcode-generator)[ Docs](http://github.com/picqer/php-barcode-generator)[ RSS](/packages/kmalisiewicz-php-barcode-generator/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

PHP Barcode Generator [![Build Status](https://camo.githubusercontent.com/d1d75efe07313ca7dca2005b482392f90d5cb8e31aacff68f87f35d0de3ade81/68747470733a2f2f7472617669732d63692e6f72672f7069637165722f7068702d626172636f64652d67656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/picqer/php-barcode-generator) [![Total Downloads](https://camo.githubusercontent.com/de932465e39d40e2fc2681bab7d0f2caab78264e7672e333bdc461cd377f4b11/68747470733a2f2f706f7365722e707567782e6f72672f7069637165722f7068702d626172636f64652d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/picqer/php-barcode-generator)
===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-barcode-generator--)

This is an easy to use, non-bloated, framework independent, barcode generator in PHP.

It creates SVG, PNG, JPG and HTML images, from the most used 1D barcode standards.

*The codebase is largely from the [TCPDF barcode generator](https://github.com/tecnickcom/TCPDF) by Nicola Asuni. This code is therefor licensed under LGPLv3. It is still a bit of a mess, bit I will clean it in the future. I do not expect the interface of this class will change during the clean ups.*

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

[](#installation)

Install through [composer](https://getcomposer.org/doc/00-intro.md):

```
composer require picqer/php-barcode-generator

```

Usage
-----

[](#usage)

Initiate the barcode generator for the output you want, then call the -&gt;getBarcode() routine as many times as you want.

```
$generator = new Picqer\Barcode\BarcodeGeneratorHTML();
echo $generator->getBarcode('081231723897', $generator::TYPE_CODE_128);
```

The -&gt;getBarcode() routine accepts the following:

- $code Data for the barcode
- $type Type of barcode, use the constants defined in the class
- $widthFactor Width is based on the length of the data, with this factor you can make the barcode bars wider then default
- $totalHeight The total height of the barcode
- $color Hex code of the foreground color

Image types
-----------

[](#image-types)

```
$generatorSVG = new Picqer\Barcode\BarcodeGeneratorSVG();
$generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
$generatorJPG = new Picqer\Barcode\BarcodeGeneratorJPG();
$generatorHTML = new Picqer\Barcode\BarcodeGeneratorHTML();
```

Accepted types
--------------

[](#accepted-types)

- TYPE\_CODE\_39
- TYPE\_CODE\_39\_CHECKSUM
- TYPE\_CODE\_39E
- TYPE\_CODE\_39E\_CHECKSUM
- TYPE\_CODE\_93
- TYPE\_STANDARD\_2\_5
- TYPE\_STANDARD\_2\_5\_CHECKSUM
- TYPE\_INTERLEAVED\_2\_5
- TYPE\_INTERLEAVED\_2\_5\_CHECKSUM
- TYPE\_CODE\_128
- TYPE\_CODE\_128\_A
- TYPE\_CODE\_128\_B
- TYPE\_CODE\_128\_C
- TYPE\_EAN\_2
- TYPE\_EAN\_5
- TYPE\_EAN\_8
- TYPE\_EAN\_13
- TYPE\_UPC\_A
- TYPE\_UPC\_E
- TYPE\_MSI
- TYPE\_MSI\_CHECKSUM
- TYPE\_POSTNET
- TYPE\_PLANET
- TYPE\_RMS4CC
- TYPE\_KIX
- TYPE\_IMB
- TYPE\_CODABAR
- TYPE\_CODE\_11
- TYPE\_PHARMA\_CODE
- TYPE\_PHARMA\_CODE\_TWO\_TRACKS

Examples
--------

[](#examples)

Embedded PNG image in HTML:

```
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
echo '';
```

###  Health Score

24

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76% 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 ~215 days

Total

3

Last Release

3442d ago

### Community

Maintainers

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

---

Top Contributors

[![casperbakker](https://avatars.githubusercontent.com/u/886975?v=4)](https://github.com/casperbakker "casperbakker (19 commits)")[![kmalisiewicz](https://avatars.githubusercontent.com/u/6594956?v=4)](https://github.com/kmalisiewicz "kmalisiewicz (2 commits)")[![amenk](https://avatars.githubusercontent.com/u/1087128?v=4)](https://github.com/amenk "amenk (1 commits)")[![binarix](https://avatars.githubusercontent.com/u/4037156?v=4)](https://github.com/binarix "binarix (1 commits)")[![frankirox](https://avatars.githubusercontent.com/u/1335554?v=4)](https://github.com/frankirox "frankirox (1 commits)")[![stephangroen](https://avatars.githubusercontent.com/u/1607643?v=4)](https://github.com/stephangroen "stephangroen (1 commits)")

---

Tags

phphtmlsvgbarcodepngEAN13jpegeanbarcode generatorCODABARupcjpgPharmacode39Standard 2 of 5MSIPOSTNETKIXcode128Code93KIXCODECode11

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kmalisiewicz-php-barcode-generator/health.svg)

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

###  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.8k24.7M74](/packages/picqer-php-barcode-generator)[tecnickcom/tc-lib-barcode

PHP library to generate linear and bidimensional barcodes

2896.9M25](/packages/tecnickcom-tc-lib-barcode)[choowx/rasterize-svg

A PHP library for converting SVG to JPEG, PNG, and WEBP

2256.8k](/packages/choowx-rasterize-svg)[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

4868.9k](/packages/jkphl-iconizr)

PHPackages © 2026

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