php+扫描条码,PHP条形码图像生成器
这是一个用于生成barocdes的简单
PHP脚本:
//For displaying barcodes
//Arguments are:
// code Number you want outputted as a barcode
//You can use this script in two ways:
// From a webpage/PHP script
// Directly in your web browser http://www.example.com/images/barcode.PHP?code=12345
//Outputs the code as a barcode,surrounded by an asterisk (as per standard)
//Will only output numbers,text will appear as gaps
//Image width is dynamic,depending on how much data there is
//Get the barcode font (called 'free3of9') from here http://www.barcodesinc.com/free-barcode-font/
header("Content-type: image/png");
$file = "images/barcode.png"; // path to base png image
$im = imagecreatefrompng($file); // open the blank image
$string = $_GET['code']; // get the code from URL
imagealphablending($im,true); // set alpha blending on
imagesavealpha($im,true); // save alphablending setting (important)
$black = imagecolorallocate($im,0); // colour of barcode
$font_height=40; // barcode font size. anything smaller and it will appear jumbled and will not be able to be read by scanners
$newwidth=((strlen($string)*20)+41); // allocate width of barcode. each character is 20px across,plus add in the asterisk's
$thumb = imagecreatetruecolor($newwidth,40); // generate a new image with correct dimensions
imagecopyresized($thumb,$im,$newwidth,40,10,10); // copy image to thumb
imagettftext($thumb,$font_height,1,$black,'c:\windows\fonts\free3of9.ttf','*'.$string.'*'); // add text to image
//show the image
imagepng($thumb);
imagedestroy($thumb);
?>
希望这可以帮助你.
php+扫描条码,PHP条形码图像生成器相关推荐
- php 条形码生成器,PHP条形码图像生成器
这是一个用于生成barocdes的简单 PHP脚本: //For displaying barcodes //Arguments are: // code Number you want output ...
- js 条码枪扫描_使用JavaScript获取扫码枪扫描得到的条形码的思路代码详解
下面通过实例代码给大家介绍js扫码枪扫描条形码的实现方法,具体代码如下所示: var keycode = ""; var lastTime=null,nextTime; var l ...
- 条码软件即时打印扫描条码打印空白的处理方法
使用条形码制作软件制作条码是非常基本的功能,最近有用户在使用条码软件的打印时输入功能时,出现扫描条码后打印空白的情况,这种肯定是不正常的,下面我们就来看一下该如何处理: 首先我们来看一下在中琅条码软件 ...
- 如何实现扫描条码自动打印标签?
近很多客户询问能不能扫描一个条形码再打印出来一个同样的条形码,今天给大家介绍如何使用易标签软件的"扫码打印"功能,利用打印时扫码录入的功能可以实现扫描条码自动打印标签的工作,下面就 ...
- 开源项目barcodelib-C#条形码图像生成库
介绍 该库旨在为开发人员提供一个简单的类,以便他们在需要根据数据字符串生成条形码图像时使用. 用法 该库包含一个名为BarcodeLib的类,其中包含三个构造函数: Barcode(); Barcod ...
- php图像无法显示,php – 无法显示图像,因为它包含错误[图像生成器]
有图像生成器的一些问题.也许你会发现问题是什么?我得到:"图像无法显示,因为它包含错误",我正在下载图像文件,但没有错误. if(isset($_GET['id']) && ...
- PDA手持终端扫描条码开单打印一体 结合后台电脑系统 数据同步交互解决方案
PDA手持终端扫描条码开单打印一体 结合后台电脑系统 数据同步交互解决方案 参考文章: (1)PDA手持终端扫描条码开单打印一体 结合后台电脑系统 数据同步交互解决方案 (2)https://www. ...
- 流水线扫描条码自动分拣方案
一.流水线扫描条码自动分拣应用场景: 生产制造业的自动流水线,包装线传送带,物流分拣流水线,条码打印在线检测. 二.流水线扫描条码自动分拣解决方案特点: 1. 无需人手扫描,大大提高效率,节省人力成本 ...
- 使用扫描枪扫描条码时字符识别写入缓慢问题(针对element-ui的el-input)优化
文章目录 问题描述 问题解决方案的摸索 问题解析 代码分享 问题描述 前段时间仓库反映扫描识别慢,应要求去仓库出差排查问题,首先仓库的电脑配置较低,而且最近加了一个扫描二维码的功能(大概有接近200个 ...
最新文章
- 如何选择合适的损失函数,请看......
- 《剑指Offer》题目:树的子结构
- 【五校联考7day1】游戏
- 微型计算机寻址方式命令,寻址方式与基本指令-微机原理实验报告.docx
- fopen,fopen_s,fclose, _fcloseall函数用法
- java解析dxf文件_浅析JVM方法解析、创建和链接
- jQuery.ajax()异步方法的漏洞
- 【MySQL】MySQL 5.7 sys Schema
- Application 用法
- android gms包
- 奔图cp2510dn linux,奔图CP2510DN驱动
- 视频播放插件 Video.js
- 2018年第九届蓝桥杯真题C/C++B组
- 评卷系统-答题卡制作参考网站
- win7计算机的用户名和密码,win7文件共享访问需要输入用户名和密码如何解决
- mysql recordcount 1_移植到 MySQL-对 MYSQL 数据库使用 ASP Recordcount 的问题
- 使用proxychains匿名浏览,清理痕迹(六)
- linux入门--磁盘管理之分区、格式化与挂载
- Google Play App Signing
- 微信营销有哪些精准吸粉的方法?