承接 sqkhor/publication-barcode 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sqkhor/publication-barcode

最新稳定版本:v1.0.2

Composer 安装命令:

composer require sqkhor/publication-barcode

包简介

For generating ISBN and ISSN barcodes.

README 文档

README

PHP script specifically for generating ISBN and ISSN barcodes.
It could be used to generate other EAN-13 barcodes too, though not designed to do so.

Installation

You could either download everything in src/ into your project, or install via composer:

composer require sqkhor/publication-barcode

Usage

use \SQKhor\Barcode\PublicationBarcode;

// ISBN
$barcode = new PublicationBarcode('978-967-2088-62-2');
$svg = $barcode->render('svg');

// ISBN with add on
$barcode = new PublicationBarcode('978-967-2088-62-2', '50999');
$png = $barcode->render('svg');

// ISSN with issue number
$barcode = new PublicationBarcode('3009-1004', '01');
$svg = $barcode->svg();

Method Parameters

new PublicationBarcode(code, [addon])

code (string)
The 13-digit ISBN / ISSN, or 8-digit ISSN code

addon (?string)
Supplimentary barcode data for price (ISBN) and issue number (ISSN)


render(format)

format (string)
Either one of these: svg | png | jpg | jpeg

Shorthands

$barcode = new PublicationBarcode('978-967-2088-62-2');
$svg = $barcode->svg();
$png = $barcode->png();
$jpg = $barcode->jpg();

Sample

ISBN:

ISSN with issue number:

To-Do

  • PNG / JPG render capability
  • Class parameters to set bar width & height
  • Reset after every use
  • Error handling
  • Comments / documentations
  • Tests

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-14