PHPackages                             matias-vdv/gs1\_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. matias-vdv/gs1\_barcode

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

matias-vdv/gs1\_barcode
=======================

Generate GS1-128 standard barcode

1.0.3(5y ago)02.6k↓33.3%MITPHPPHP &gt;=5.4.0

Since Oct 2Pushed 5y agoCompare

[ Source](https://github.com/Matias-Vdv/gs1_128)[ Packagist](https://packagist.org/packages/matias-vdv/gs1_barcode)[ RSS](/packages/matias-vdv-gs1-barcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

GS1 barcode generator
=====================

[](#gs1-barcode-generator)

The library generates GS1 barcode. Currently supported formats: GS1 128.

Install
-------

[](#install)

Note that library requires both GD and Free Type extensions installed

```
composer install ayeo/gs1_barcode:1.0.*

```

Usage
-----

[](#usage)

The simplest example:

```
use Ayeo\Barcode;

$builder = new Barcode\Builder();
$builder->output('(10)123456(400)11');
```

This will generate png image using black and white and default font

[![barcode](https://camo.githubusercontent.com/fcf77e593413594ddc875d059125f09aaa15d81b8caaa0d698899cbd2a52c543/687474703a2f2f712e692d73797374656d732e706c2f66696c652f66613836393337352e706e67 "Generated barcode")](https://camo.githubusercontent.com/fcf77e593413594ddc875d059125f09aaa15d81b8caaa0d698899cbd2a52c543/687474703a2f2f712e692d73797374656d732e706c2f66696c652f66613836393337352e706e67)

Custom barcode:

```
use Ayeo\Barcode;

$builder = new Barcode\Builder();
$builder->setBarcodeType('gs1-128');
$builder->setFilename('barcode.png');
$builder->setImageFormat('png');
$builder->setWidth(500);
$builder->setHeight(150);
$builder->setFontPath('FreeSans.ttf');
$builder->setFontSize(15);
$builder->setBackgroundColor(255, 255, 255);
$builder->setPaintColor(0, 0, 0);
```

Finally, you can use the output method to stream the image directly to the web browser.

```
$builder->output('(10)123456(400)11');
```

If you want to save the image file, you can use the saveImage method instead.

```
$builder->saveImage('(10)123456(400)11');
```

Acctualy generate the dame barcode becouse all params all set to default values. This shows only available settings

Fluent interface is welcome

```
use Ayeo\Barcode;

Barcode\Builder::build()->setWidth(600)->setBackgroundColor(100, 100, 100)->output('(10)123456(400)11');
```

Additional info
---------------

[](#additional-info)

- Supported image formats: png, jpg
- Barcode must be valid GS1 barcode

Contributing
------------

[](#contributing)

Everyone is welcome, feel free to join

Supported identifiers
---------------------

[](#supported-identifiers)

The goal is to support all existing gs1 application identifiers but at the moment I have added only those I needed. Feel free to add or request some. Full list is [here](http://www.databar-barcode.info/application-identifiers)

CodeNameMin lengthMax length00SERIAL SHIPPING CONTAINER CODE181801GLOBAL TRADE ITEM NUMBER141402ITEM TRADE ITEM NUMBER141410BATCH NUMBER12012PAYMENT DATE (YYMMDD)6615BEST BEFORE DATE (YYMMDD)6617EXPIRATION DATE (YYMMDD)6637NUMBER OF UNITS CONTAINED183301CONTAINER GROSS WEIGHT (KG)66390(n)AMOUNT PAYABLE - SINGLE MONETARY AREA115400CUSTOMER PURCHASE ORDER NUMBER130415GLOBAL LOCATION NUMBER OF THE INVOICE PARTY13138020PAYMENT SLIP REFERENCE NUMBER12596COMPANY INTERNAL INFORMATION130

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 53.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 ~585 days

Total

4

Last Release

2118d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68728277?v=4)[matias-vdv](/maintainers/matias-vdv)[@Matias-Vdv](https://github.com/Matias-Vdv)

---

Top Contributors

[![javierportillo](https://avatars.githubusercontent.com/u/17260001?v=4)](https://github.com/javierportillo "javierportillo (8 commits)")[![ayeo](https://avatars.githubusercontent.com/u/60191?v=4)](https://github.com/ayeo "ayeo (7 commits)")

---

Tags

barcodegs1gs1-128

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matias-vdv-gs1-barcode/health.svg)

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

###  Alternatives

[mike42/escpos-php

PHP receipt printer library for use with ESC/POS-compatible thermal and impact printers

2.7k1.9M22](/packages/mike42-escpos-php)[ayeo/gs1_barcode

Generate GS1-128 standard barcode

52112.1k](/packages/ayeo-gs1-barcode)[bitgrave/barcode-bundle

provide barcode rendering service into your Symfony2 application.

25444.0k1](/packages/bitgrave-barcode-bundle)[z38/metzli

PHP library to generate Aztec barcodes

26315.2k](/packages/z38-metzli)[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)
