4
消失我设置了TCPDF在飞行中为客户生成发票,但是当我添加图像,边界是从我的表消失。下面的代码:表格边框在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>';
表显示正常与上面的代码,但只要我去掉图像位,出现图像,但表格边框消失了。我试过向单个单元格添加内联边框,但这不会产生任何影响。
有没有人有任何想法?
谢谢EPB - 增加$ PDF-setPageMark()定了! – 2013-02-27 08:58:01
是的,这是我的问题,所有我有我忘了写“”结尾的代码。 – jazkat 2013-10-17 08:43:04
我有类似的问题,但我没有图片,据我所知。只需一张我想打印出来的表格,其中包含值,我将其添加到现有的PDF中。我看到表格边框闪烁,然后当它消失时,PDF加载,然后表格中的值加载,但是它们周围没有表格边框可见。我有,我试着在不同的地方放置setPageMark(),但目前没有帮助。 – Dennis 2014-03-04 18:20:56