[英]Get 2D barcode in TCPDF html table
我试图在 HTML 表格中获取二维条码 (QR)。 我得到以下代码:
$style = array(
'vpadding' => 'auto',
'hpadding' => 'auto',
'fgcolor' => array(0,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, 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, 0, '', '', $html, 0, 1, 0, true, '', true);
目标是获取 html 表中的二维码。
我尝试了 TCPDF 中的示例 49,但我不断收到错误消息,只将包含文件名从“tcpdf_include.php”更改为“tcpdf.php”:
“TCPD 错误:部分数据已输出,无法发送 PDF 文件”
找到了答案。 正在寻找错误的东西。 答: TCPDF ERROR:部分数据已经输出,无法发送PDF文件
使用了来自 TCPDF 的示例 49 并添加了ob_end_clean();
在输出之前。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.