TCPDF渲染问题

时间:2013-11-15 11:02:00

标签: php tcpdf

我遇到了tcpdf和渲染div的问题。以下是我的代码的简化版本:

<?php
require_once (APP . 'vendors/xtcpdf.php'); 
ob_clean();
$tcpdf = new XTCPDF(); 
$tcpdf->AddPage(); 

$html = '<div style="width: 333px;height: 750px;float: left;border: 1px solid black;">     
        Col One Test
</div>

<div style="width: 333px;height: 750px;float: left;border: 1px solid black;">      
        Col Two Test
</div>

<div style="width: 333px;height: 750px;float: left;border: 1px solid black;">       
        Col Three Test
</div>';

$tcpdf->writeHTML($html, true, false, true, false, '');
echo $tcpdf->Output('test.pdf', 'D'); 
?>

XTCPDF只是覆盖页眉和页脚的扩展,所以在这里不相关,因为它现在还没有使用。将此数据放入PDF时会出现问题。以下是代码在网页中显示时的呈现方式:

enter image description here

然而,当以PDF格式呈现时,这就是我得到的:

enter image description here

干杯, 克里斯。

0 个答案:

没有答案