博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
php生成条形码: barcodegen
阅读量:4653 次
发布时间:2019-06-09

本文共 991 字,大约阅读时间需要 3 分钟。

实例结构:

1. index.html

 

Test with embedded image  barcode

  

2. buildcode.php

 

setScale(2); // Resolution $code->setThickness(30); // Thickness $code->setForegroundColor($color_black); // Color of bars $code->setBackgroundColor($color_white); // Color of spaces $code->setFont($font); // Font (or 0) $code->parse($text); // Text} catch(Exception $exception) { $drawException = $exception;}/* Here is the list of the arguments1 - Filename (empty : display on screen)2 - Background color */$drawing = new BCGDrawing('', $color_white);if($drawException) { $drawing->drawException($drawException);} else { $drawing->setBarcode($code); $drawing->draw();}// Header that says it is an image (remove it if you save the barcode to a file)header('Content-Type: image/png');header('Content-Disposition: inline; filename="barcode.png"');// Draw (or save) the image into PNG format.$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);?>

  

3. barcode 类库下载地址: ~

效果:

 

 

 

 

 

;

转载于:https://www.cnblogs.com/upup2015/p/7782626.html

你可能感兴趣的文章
LeetCode——Find Duplicate Subtrees
查看>>
php5.5编译安装
查看>>
@-webkit-keyframes 动画 css3
查看>>
搭建Maven工程的时候,做单元测试,报ClassNotFoundException
查看>>
XPath轴
查看>>
Struts2的优点与Struts1的区别:
查看>>
5-29 删除字符串中的子串
查看>>
webdriver模拟鼠标操作
查看>>
Spring cloud 基础
查看>>
游戏开发Unity渲染场景光照性能优化 ShaderLOD
查看>>
java中构造方法的使用
查看>>
使用Expression动态创建lambda表达式
查看>>
MapReduce
查看>>
找工作——JVM内存管理
查看>>
【Flask】在Flask中使用logger
查看>>
好系统重装助手教你如何让win10系统快速开机
查看>>
计算机操作系统概述
查看>>
代理模式
查看>>
Infraware推出Tizen应用生成器Polaris,可转换Android应用至Tizen平台
查看>>
luogu1345 奶牛的电信 (最小割)
查看>>