tklovett/barcodes 问题修复 & 功能扩展

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

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

tklovett/barcodes

最新稳定版本:V3.0

Composer 安装命令:

composer require tklovett/barcodes

包简介

Barcode generator for PHP supporting 20+ barcode types

README 文档

README

Latest Stable Version Total Downloads Build Status Coverage Status Scrutinizer Code Quality

Read More Wiki

Generating barcodes in PHP since 2015!

Generates HTML, PNG, or SVG canvas

Supported Barcode Types

One Dimensional

  • Codabar
  • Code 11
  • Code 39 (also extended and/or with check-digit)
  • Code 93
  • Code 128 (A, B, C, or Auto)
  • EAN (2, 5, 13)
  • Intelligent Mail
  • Interleave 2 of 5
  • MSI (also with check-digit)
  • Pharmacode
  • POSTNET (or PLANET)
  • RMS4CC (or KIX)
  • Standard 2 of 5 (also with check-digit)
  • UPC (A, E)

Two Dimensional

  • DataMatrix
  • PDF417
  • QR Code

Requirements

  • Barcodes requires ImageMagick to create PNGs in PHP 5.3.
  • Barcodes requires PHP bcmath extension for Intelligent Mail barcodes

Installation

You can install this package with the Composer CLI:

composer require tklovett/barcodes

Or manually add the dependency to your project's composer.json:

"require": {
    "tklovett/barcodes": "dev-master"
}

And tell composer to install it:

composer install

Usage

First instantiate a BarcodeGenerator factory:

$generator = new BarcodeGenerator();

Then tell it to generate the barcode type of your choice for your code:

$barcode = generator.generate(BarcodeType::QR_CODE, "This is what I want encoded");

Finally, output SVG, HTML, or a PNG:

$svg  = $barcode.toSVG();
$html = $barcode.toHTML();
$png  = $barcode.toPNG();

Need a custom height, width, or color for your barcode? No problem:

$width = 20;
$height = 30;
$color = 'blue';
$sizedSVG  = $barcode.toSVG($width, $height, $color);
$sizedHTML = $barcode.toSVG($width, $height, $color);
$sizedPNG  = $barcode.toSVG($width, $height, $color);

TODO:

  • Convert snake_case method names to camelCase
  • Replace returns from barcode constructors with exception throws
  • Write tests
  • Write docs
  • parent::__construct($code); in all barcodes
  • remove unused methods

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 66
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固