mhinspeya/module-barcode-generator 问题修复 & 功能扩展

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

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

mhinspeya/module-barcode-generator

Composer 安装命令:

composer require mhinspeya/module-barcode-generator

包简介

Magento 2 module for generating 1D barcodes (Code 39, Code 128, EAN, UPC, and more)

README 文档

README

A Magento 2 module for generating 1D barcodes as PNG, SVG, or HTML output. Based on the TCPDF barcode library by Nicola Asuni.

Compatibility

MagentoPHP
2.4.8+8.2 / 8.3 / 8.4

Supported Barcode Types

CodeDescription
C39CODE 39 – ANSI MH10.8M-1983
C39+CODE 39 with checksum
C39ECODE 39 Extended
C39E+CODE 39 Extended + checksum
C93CODE 93 – USS-93
S25Standard 2 of 5
S25+Standard 2 of 5 + checksum
I25Interleaved 2 of 5
I25+Interleaved 2 of 5 + checksum
C128CODE 128 (auto mode)
C128ACODE 128 A
C128BCODE 128 B
C128CCODE 128 C
EAN22-Digit UPC-Based Extension
EAN55-Digit UPC-Based Extension
EAN8EAN-8
EAN13EAN-13
UPCAUPC-A
UPCEUPC-E
MSIMSI (Plessey variation)
MSI+MSI + checksum (modulo 11)
POSTNETPOSTNET
PLANETPLANET
RMS4CCRoyal Mail 4-state Customer Code
KIXKIX (Klant index – Customer index)
IMBIntelligent Mail Barcode (USPS-B-3200)
CODABARCODABAR
CODE11CODE 11
PHARMAPHARMACODE
PHARMA2TPHARMACODE Two-Tracks

Installation

Via Composer

composer require mhinspeya/module-barcode-generator
bin/magento module:enable MHinspeya_BarcodeGenerator
bin/magento setup:upgrade
bin/magento cache:flush

Manual Installation

  1. Copy the module files to app/code/MHinspeya/BarcodeGenerator/
  2. Run:
bin/magento module:enable MHinspeya_BarcodeGenerator
bin/magento setup:upgrade
bin/magento cache:flush

Usage

Frontend URL

The module registers a frontend route. Generate a barcode PNG by visiting:

https://your-store.com/barcode/index/barcode?code=C128&number=123456789

Parameters:

ParameterDescriptionExample
codeBarcode type (see supported types)C128
numberValue to encode123456789

Programmatic Usage

use MHinspeya\BarcodeGenerator\Helper\BarcodeHelper;

// Create a barcode instance
$barcode = new BarcodeHelper('123456789', 'C128');

// Get PNG image data as a string
$pngData = $barcode->getBarcodePNGData(2, 40, [0, 0, 0]);

// Get SVG markup
$svgCode = $barcode->getBarcodeSVGcode(2, 30, 'black');

// Get HTML markup
$htmlCode = $barcode->getBarcodeHTML(2, 30, 'black');

// Get the raw barcode array
$barcodeArray = $barcode->getBarcodeArray();

License

LGPL-3.0-or-later — Based on the TCPDF barcode library by Nicola Asuni.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2026-06-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固