Php 使用Google Chart API/ZXING库创建1D条形码
我正在尝试使用PHP创建一维条形码。我已经能够使用google chart api创建二维二维二维条形码,如下所示:Php 使用Google Chart API/ZXING库创建1D条形码,php,zxing,google-visualization,Php,Zxing,Google Visualization,我正在尝试使用PHP创建一维条形码。我已经能够使用google chart api创建二维二维二维条形码,如下所示: $size = $_REQUEST['size']; $string = preg_replace('/\s+/','',$_REQUEST['content']); $content = $string;//$_REQUEST['content']; $correction = strtoupper($_REQUEST['correction']); $en
$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.'">';
$size=$\u请求['size'];
$string=preg_replace('/\s+/','',$请求['content']);
$content=$string//$_请求[‘内容’];
$correction=strtoupper($_请求['correction']);
$encoding=$_请求['encoding'];
//表单谷歌图表api链接
$rootUrl=”https://chart.googleapis.com/chart?cht=qr&chs=$size&chl=$content&choe=$encoding&chld=$correction”;
//打印出图像
回声';
此代码只生成二维码。但我需要条形码。我需要更改哪些参数才能将其显示为1D条形码???请注意,我正在使用PHP语言,并使用Zxing库解码数据。请提供帮助。谢谢您使用的API已弃用()。据我所知,谷歌并不提供1D条形码生成器API 我建议你停止使用这个API,下载一个可以生成条形码的类。ZF示例: