我正在设置 tcpdf 为客户即时生成发票,但是当我添加图像时,边框从我的桌子上消失了。这是代码:
/*
if ($status == "Paid") {
$pdf->Image("/wp-content/themes/Feather/images/Paid.jpg", 10, 60, 190, '', '', '', 'T', false, "300", '', false, false, 0, false, false, false);
} elseif ($status == "Overdue") {
$pdf->Image("/wp-content/themes/Feather/images/Overdue.jpg", 10, 60, 190, '', '', '', 'T', false, "300", '', false, false, 0, false, false, false);
} elseif ($status == "Cancelled") {
$pdf->Image("/wp-content/themes/Feather/images/Void.jpg", 10, 60, 190, '', '', '', 'T', false, "300", '', false, false, 0, false, false, false);
}
*/
$pdf->SetXY($x=20, $y=30);
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->lastPage();
这是我正在使用的 HTML:
$html = $html . '
<br/><br/><br/>
<table width="600px" cellspacing="1" cellpadding="4" border="1">
<tr>
<th width="200px">Product</th>
<th width="65px">Code</th>
<th width="65px">Quantity</th>
<th width="65px">Unit Price</th>
<th width="65">VAT Rate</th>
<th width="65">VAT Amount</th>
<th width="65">Line Total</th>
</tr>';
foreach ($inv_lines as $inv_line) {
$html = $html .
'<tr>
<td>' . $inv_line['item_desc'] . '</td>
<td>' . $inv_line['item_no'] . '</td>
<td>' . $inv_line['quantity'] . '</td>
<td>' . $inv_line['unit_price'] . '</td>
<td>' . $inv_line['vat_rate'] . '</td>
<td>' . ($inv_line['quantity'] * $inv_line['vat_rate'] * $inv_line['unit_price'] * 0.01) . '</td>
<td>' . $inv_line['line_total'] . '</td>
</tr>';
使用上面的代码,表格看起来很好,但是一旦我取消注释图像位,图像就会出现,但表格边框会消失。我尝试向单个单元格添加内联边框,但这不会产生任何影响。
有没有人有任何想法?