如何解决在TCPDF html表中获取二维条码
我正在尝试在HTML表中获取2D条形码(QR)。我得到以下代码:
$style = array(
'vpadding' => 'auto','hpadding' => 'auto','fgcolor' => array(0,0),'bgcolor' => false,//array(255,255,255)
'module_width' => 1,// width of a single module in points
'module_height' => 1 // height of a single module in points
);
$pdf->write2DBarcode('http://localhost/VERP/logistics/view_warehouse.php?id='.$warehouse->wa_id.'','QRCODE,L',20,30,50,$style,'N');
// Set some content to print
$html = <<<EOD
<table border =".5" style="line-height:20px; width:100%;">
<tr>
<td style="height:490px">test</td>
</tr>
</table>
<table border =".5" style="line-height:20px; width:100%;">
<tr>
<td style="height:490px">test</td>
</tr>
</table>
EOD;
// Print text using writeHTMLCell()
$pdf->writeHTMLCell(0,'',$html,1,true,true);
目标是在html表中获取QR码。
我从TCPDF尝试了示例49,但是我始终通过仅将包含文件名从'tcpdf_include.php'更改为'tcpdf.php'而得到错误消息:
“ TCPDF错误:某些数据已经输出,无法发送PDF文件”
解决方法
找到了答案。正在寻找错误的事物。回答: TCPDF ERROR: Some data has already been output,can't send PDF file
使用TCPDF中的示例49并添加
ob_end_clean();
在输出之前。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。