我正在尝试使用PHP.创建一维条形码。我已经能够使用google chart api创建二维二维码,如下所示:
$size = $_REQUEST['size'];
$string = preg_replace('/\s+/','',$_REQUEST['content']);
$content = $string;//$_REQUEST['content'];
$correction = strtoupper($_REQUEST['correction']);
$encoding = $_REQUEST['encoding'];
//form google chart api link
$rootUrl = "https://chart.googleapis.com/chart?cht=qr&chs=$size&chl=$content&choe=$encoding&chld=$correction";
//print out the image
echo '<img src="'.$rootUrl.'">';
此代码仅生成我需要的QR code.But barcode.What我需要更改参数才能将其显示为一维条形码吗?请注意,我使用的是PHP语言,使用Zxing library.Please help.Thanks解码数据
发布于 2013-02-26 23:06:13
您正在使用的API已弃用(https://developers.google.com/chart/infographics/)。据我所知,Google没有提供一维条形码生成器API。
我建议您停止使用此API,下载一个可以生成条形码的类。ZF示例:http://framework.zend.com/manual/1.12/en/zend.barcode.creation.html
https://stackoverflow.com/questions/15092242
复制相似问题