在 TCPDF 中获取二维条码 html table
Get 2D barcode in TCPDF html table
我正在尝试在 HTML table 中获取二维条码 (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);
目标是获取htmltable里面的二维码。
我尝试了 TCPDF 中的示例 49,但我不断收到错误消息,只是将包含文件名从 'tcpdf_include.php' 更改为 'tcpdf.php':
"TCPDF ERROR: Some data has already been output, can't send PDF file"
找到答案了。正在寻找错误的东西。回答:
TCPDF ERROR: Some data has already been output, can't send PDF file
使用了 TCPDF 中的示例 49 并添加了
ob_end_clean();
在输出之前。
我正在尝试在 HTML table 中获取二维条码 (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);
目标是获取htmltable里面的二维码。
我尝试了 TCPDF 中的示例 49,但我不断收到错误消息,只是将包含文件名从 'tcpdf_include.php' 更改为 'tcpdf.php':
"TCPDF ERROR: Some data has already been output, can't send PDF file"
找到答案了。正在寻找错误的东西。回答: TCPDF ERROR: Some data has already been output, can't send PDF file
使用了 TCPDF 中的示例 49 并添加了
ob_end_clean();
在输出之前。