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 8mo 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

15

—

LowBetter than 3% of packages

Maintenance42

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://avatars.githubusercontent.com/u/551820?v=4)[Tony Nguyen](/maintainers/nguyenduytan)[@nguyenduytan](https://github.com/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

[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495240.6k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

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