PHPackages                             dangex/cod\_gs1\_128 - 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. dangex/cod\_gs1\_128

ActiveLibrary

dangex/cod\_gs1\_128
====================

Generate GS1-128 standard barcode

1.0(10y ago)011.7k↓100%MITPHPPHP &gt;=5.4.0

Since Oct 2Pushed 8y agoCompare

[ Source](https://github.com/dangex/cod_gs1_128)[ Packagist](https://packagist.org/packages/dangex/cod_gs1_128)[ RSS](/packages/dangex-cod-gs1-128/feed)WikiDiscussions master Synced today

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

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

[](#gs1-barcode-generator)

The library generates GS1 barcode base64. Currently supported formats: GS1 128. Code is under development so it may change radically. If you found an issue just let me know.

Usage
-----

[](#usage)

The simplest example:

```
$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:

```
$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

```
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)6637NUMBER OF UNITS CONTAINED183301CONTAINER GROSS WEIGHT (KG)663902AMOUNT PAYABLE - SINGLE MONETARY AREA115400CUSTOMER PURCHASE ORDER NUMBER130415GLOBAL LOCATION NUMBER OF THE INVOICE PARTY13138020PAYMENT SLIP REFERENCE NUMBER12596COMPANY INTERNAL INFORMATION130

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

3825d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68ca6adfa1973bf7882c2907c43dac2b5780d915d438fef38c67afa646da417c?d=identicon)[dangex](/maintainers/dangex)

---

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 (4 commits)")[![dangex](https://avatars.githubusercontent.com/u/30252169?v=4)](https://github.com/dangex "dangex (3 commits)")[![JPPreusDev](https://avatars.githubusercontent.com/u/7678067?v=4)](https://github.com/JPPreusDev "JPPreusDev (2 commits)")

---

Tags

barcodegs1gs1-128

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dangex-cod-gs1-128/health.svg)

```
[![Health](https://phpackages.com/badges/dangex-cod-gs1-128/health.svg)](https://phpackages.com/packages/dangex-cod-gs1-128)
```

###  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)[khanamiryan/qrcode-detector-decoder

QR code decoder / reader

1.4k31.1M64](/packages/khanamiryan-qrcode-detector-decoder)[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.5k12.9M33](/packages/milon-barcode)[mike42/escpos-php

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

2.7k1.8M22](/packages/mike42-escpos-php)[ronanguilloux/isocodes

PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book and Music Industries, Phone numbers &amp; Zipcodes for many countries

8103.3M23](/packages/ronanguilloux-isocodes)[ayeo/gs1_barcode

Generate GS1-128 standard barcode

52109.8k](/packages/ayeo-gs1-barcode)

PHPackages © 2026

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