horde/barcode 问题修复 & 功能扩展

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

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

horde/barcode

最新稳定版本:v1.0.0alpha1

Composer 安装命令:

composer require horde/barcode

包简介

Horde Barcode and QR Code Rendering and Parsing Library

README 文档

README

Barcode and QR code generation and reading library for PHP 8.1+.

Encodes data into 1D and 2D barcode symbologies and renders them as HTML, raster images (via horde/Image), SVG or PDF (via horde/Pdf). Decodes barcodes from module matrices and bar patterns back into structured data. Includes a semantic layer for some popular structured payload formats (payments, contacts, WiFi, GS1, healthcare, etc.) with bidirectional encode/decode support.

Status: Encoding and rendering are fully implemented. Reading/decoding from images is designed (interfaces defined) but not yet implemented. Contributions welcome. :)

Quick Start

use Horde\Barcode\Barcode;

// QR code as HTML table
echo Barcode::qrHtml('https://www.horde.org/');

// Code 128 as HTML
echo Barcode::code128Html('INV-2026-0042');

// EAN-13 as HTML
echo Barcode::eanHtml('5901234123457');

// Data Matrix as HTML
echo Barcode::dataMatrixHtml('Serial:ABC123');

Requirements

  • PHP 8.1+ with ext-mbstring
  • No other required dependencies (HTML renderer is standalone)

Optional

  • horde/image for raster (PNG/JPEG) and SVG output
  • horde/pdf for PDF output
  • horde/otp for OTP provisioning URI generation

Installation

composer require horde/barcode

Supported Standards

Barcode Symbologies

Class Standard Common Name Description
QrEncoder ISO/IEC 18004 QR Code 2D matrix barcode, versions 1–40, EC levels L/M/Q/H
DataMatrixEncoder ISO/IEC 16022 Data Matrix 2D matrix barcode, ECC200 error correction
Code128Encoder ISO/IEC 15417 Code 128 High-density linear barcode, character sets A/B/C
EanUpcEncoder ISO/IEC 15420 EAN/UPC Retail point-of-sale (EAN-13, EAN-8, UPC-A, UPC-E)
Code39Encoder ISO/IEC 16388 Code 39 Alphanumeric linear barcode (A–Z, 0–9, symbols)
Itf14Encoder ISO/IEC 16390 ITF-14 Interleaved 2-of-5 for shipping cartons

Semantic Payload Formats

Class Format Use Case Reference
OtpProvisioning otpauth:// URI TOTP/HOTP provisioning Google Authenticator Key URI
WiFi WIFI:…;; WiFi network sharing WPA3 / Wi-Fi Alliance
VCard MECARD:…;; Contact sharing NTT DoCoMo MeCard
Url HTTP/HTTPS URL Web links RFC 3986
Email mailto: URI Email composition RFC 6068
Sms smsto: URI SMS composition RFC 5724
Tel tel: URI Phone dialing RFC 3966
SepaEpc EPC069-12 EU SEPA credit transfer European Payments Council
EmvQr EMVCo Merchant QR Payment terminal QR EMVCo QR Specification
Pix BCB Pix Brazilian instant payments Banco Central do Brasil
Upi UPI Deep Link Indian instant payments NPCI UPI
Gtin GTIN-8/12/13/14 Product identification GS1 GTIN
Gs1Barcode GS1 AI Element Strings Supply chain data GS1 General Specifications
DigitalLink GS1 Digital Link URI Web-resolvable product IDs GS1 Digital Link
IataBcbp IATA Resolution 792 Airline boarding passes IATA BCBP
Udi FDA 21 CFR 830 / EU MDR Medical device identification FDA UDI
Hibc ANSI/HIBC 2.6 Healthcare product labeling HIBCC

Documentation

See doc/USAGE.md for full API documentation and examples.

License

LGPL-2.1 — see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-2.1
  • 更新时间: 2026-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固