【问题标题】:Get 2D barcode in TCPDF html table在 TCPDF html 表中获取二维条码
【发布时间】:2020-12-24 18:13:30
【问题描述】:

我试图在 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”:

“TCPPDF 错误:部分数据已经输出,无法发送 PDF 文件”

【问题讨论】:

    标签: php tcpdf


    【解决方案1】:

    找到了答案。正在寻找错误的东西。回答: TCPDF ERROR: Some data has already been output, can't send PDF file

    使用来自 TCPDF 的示例 49 并添加 ob_end_clean(); 在输出之前。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-22
      • 1970-01-01
      • 1970-01-01
      • 2015-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-25
      相关资源
      最近更新 更多