ndtan/ndt-multi-code 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ndtan/ndt-multi-code

Composer 安装命令:

composer require 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 & advanced options (SVG/PNG/JPG/TIFF/PDF/GIF/WebP).

README 文档

README

Author: Tony Nguyen • Email: admin@ndtan.net • Website: https://nguyenduytan.com
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 & advanced options. Output formats: SVG (default), PNG, JPG, TIFF, PDF, GIF, WebP.

Install

composer require ndtan/ndt-multi-code

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

Quick Start

Simple

use ndtan\Core\Generator;

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

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 & 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 & 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

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

HTTP demo

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

Tests

composer install
vendor/bin/phpunit

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.

ndtan/ndt-multi-code 适用场景与选型建议

ndtan/ndt-multi-code 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ndtan/ndt-multi-code 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ndtan/ndt-multi-code 我们能提供哪些服务?
定制开发 / 二次开发

基于 ndtan/ndt-multi-code 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 36
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-13