博客
关于我
强烈建议你试试无所不能的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

你可能感兴趣的文章
[2017.02.23] Java8 函数式编程
查看>>
sprintf 和strcpy 的差别
查看>>
JS中window.event事件使用详解
查看>>
ES6深入学习记录(一)class方法相关
查看>>
C语言对mysql数据库的操作
查看>>
INNO SETUP 获得命令行参数
查看>>
HTML5与CSS3权威指南之CSS3学习记录
查看>>
docker安装部署
查看>>
AVL树、splay树(伸展树)和红黑树比较
查看>>
多媒体音量条显示异常跳动
查看>>
运算符及题目(2017.1.8)
查看>>
React接入Sentry.js
查看>>
ssh自动分发密匙脚本样板
查看>>
转 小辉_Ray CORS(跨域资源共享)
查看>>
Linux安装postgresql
查看>>
MyBatis启动:MapperStatement创建
查看>>
【 全干货 】5 分钟带你看懂 Docker !
查看>>
[转]优化Flash性能
查看>>
popStar手机游戏机机对战程序
查看>>
lambda表达式树
查看>>