PHPackages                             ndtan/ndt-multi-code - 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. ndtan/ndt-multi-code

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

ndtan/ndt-multi-code
====================

NDT Multi-Code: unified PHP library to generate QR, DataMatrix, UPC/EAN, Code 39/93/128, ITF, PDF417 (Aztec planned) with simple &amp; advanced options (SVG/PNG/JPG/TIFF/PDF/GIF/WebP).

00PHPCI passing

Since Oct 13Pushed 7mo agoCompare

[ Source](https://github.com/nguyenduytan/NDT-Multi-Code)[ Packagist](https://packagist.org/packages/ndtan/ndt-multi-code)[ RSS](/packages/ndtan-ndt-multi-code/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

NDT Multi-Code (PHP)
====================

[](#ndt-multi-code-php)

> Author: Tony Nguyen • Email:  • Website:
> Namespace: `ndtan` • License: MIT

A unified PHP library to generate **QR**, **Data Matrix**, **UPC-A / UPC-E**, **EAN-8 / EAN-13**, **Code 39 / Code 93 / Code 128**, **ITF**, **PDF417** (**Aztec planned**) with **simple** &amp; **advanced** options. Output formats: **SVG** (default), **PNG**, **JPG**, **TIFF**, **PDF**, **GIF**, **WebP**.

---

Install
-------

[](#install)

```
composer require ndtan/ndt-multi-code
```

> Requires PHP &gt;= 8.1. For raster/PDF outputs, consider installing `ext-gd`, `ext-imagick` or `dompdf/dompdf`.

---

Quick Start
-----------

[](#quick-start)

### Simple

[](#simple)

```
use ndtan\Core\Generator;

$gen = new Generator();                 // SVG default
$res = $gen->generate('qr', 'HELLO NDT');
file_put_contents('qr.svg', $res->getBytes());
```

### Advanced

[](#advanced)

```
use ndtan\Core\Generator;

$gen = new Generator();
$res = $gen->generate('code128', '1234567890', [
  'format' => 'png',
  'moduleSize' => 3,
  'margin' => 10,
  'foreground' => '#111',
  'background' => '#fff0',
  'humanReadable' => [
    'enabled' => true,
    'text' => null,
    'fontSize' => 12,
    'position' => 'bottom'
  ],
  // Symbology-specific:
  'subset' => 'C',   // Code128 A|B|C|auto
  'fnc1' => false
]);
file_put_contents('code128.png', $res->getBytes());
```

---

Supported Types &amp; Constraints (summary)
-------------------------------------------

[](#supported-types--constraints-summary)

- **qr** — Options: `version(1-40|auto)`, `ecc(L|M|Q|H)`, `mask(0-7|auto)`, `eci`, `micro(false)`; Quiet zone ≥ 4 modules.
- **datamatrix** — Options: `size(auto|fixed)`, `encoding(auto|ASCII|C40|Text|X12|EDIFACT|Base256)`; Quiet zone ≥ 1 module.
- **pdf417** — Options: `columns(1-30)`, `rows(3-90)`, `securityLevel(0-8)`, `compact`, `aspectRatio`.
- **code128** — Options: `subset(A|B|C|auto)`, `fnc1`.
- **code39** — Options: `fullAscii`, `checksumMod43`, `narrowToWideRatio(2.0-3.0)`; Alphabet restrictions.
- **code93** — Options: `fullAscii`; auto C &amp; K checksums.
- **itf** — Options: `bearerBars(none|frame|top-bottom)`, `checksum`, `narrowToWideRatio`; Numeric, even length.
- **ean13/ean8** — Numeric only; EAN-13 length 12 data; EAN-8 length 7 data (checksums auto).
- **upca/upce** — UPC-A length 11 data; UPC-E 6 data (compressible subset only).
- **aztec** — Planned; currently returns `E_UNSUPPORTED_TYPE`.

---

CLI
---

[](#cli)

```
./bin/ndt-multi-code --type qr --data "Xin chao" --format svg --out out/qr.svg --ecc Q --margin 8
```

HTTP demo
---------

[](#http-demo)

```
php -S localhost:8080 -t src/Http
# GET http://localhost:8080/?type=ean13&data=590123412345&format=png
```

---

Tests
-----

[](#tests)

```
composer install
vendor/bin/phpunit
```

---

Notes
-----

[](#notes)

- Raster/PDF require appropriate extensions (GD/Imagick/Dompdf). If missing, you'll get `E_RENDERER_BACKEND_MISSING` or a graceful fallback to SVG.
- Aztec is planned; for now the generator throws `E_UNSUPPORTED_TYPE`.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance45

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ca16f1af8c1f64b8215ccd887ddc6cfe36232b3520d88d387fa1cd735eeae4b?d=identicon)[nguyenduytan](/maintainers/nguyenduytan)

---

Top Contributors

[![nguyenduytan](https://avatars.githubusercontent.com/u/551820?v=4)](https://github.com/nguyenduytan "nguyenduytan (8 commits)")

### Embed Badge

![Health badge](/badges/ndtan-ndt-multi-code/health.svg)

```
[![Health](https://phpackages.com/badges/ndtan-ndt-multi-code/health.svg)](https://phpackages.com/packages/ndtan-ndt-multi-code)
```

###  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)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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