HTML to PDF页脚重叠
问题描述:
class.php`类文件将文档从HTML转换为PDF。我的表格是动态的,因此整个内容可能不适合pdf的一页。现在,我的客户需要,我必须把公司名称上的每个PDF页面的页脚,所以我已经把这个HTMLHTML to PDF页脚重叠
<page_footer class="sou">
<br><br>
<div style="text-align:center;">_______________________________________________</div>
<br>
<div style="text-align:center;">Este contrato foi elaborado em <a href="javascript:void(0)">www.contratorapido.com.br</a></div>
<div style="text-align: right"><?php echo $order->order_id;?> página [[page_cu]] de [[page_nb]]</div>
</page_footer>
但这页脚重叠我用创建PDF,是pdf .The代码的内容
include('../../includes/config.php');
if($_SESSION['cont_id']!=11)
{
header('location:'.SITEURL.'/my_account.php');
}
ob_start();
include(dirname(__FILE__).'/res/config.php');
include(dirname(__FILE__).'/res/pdf_urban.php');
$content = ob_get_clean();
require_once(dirname(__FILE__).'/../html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15', array(16, 25, 16, 21));
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('Contract.pdf');
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}
请帮我解决这个问题,我怎样才能把页脚放在每一页上,而不会与主要内容重叠。
答
下面尝试使用html2pdf库
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt">
<page_header>
<div>
YOUR CONTENT FOR HEADER
</div>
</page_header>
<page_footer>
<div>
YOUR CONTENT FOR FOOTER
</div>
</div>
</page_footer>
<bookmark title="Presentation" level="0" ></bookmark>
<div style="margin:0 auto; font-size: 12px; color:#333">
<div>
CONTETN OF MIDDEL PAGES
</div>
</div>
</page>
我曾与HTML2PDF很多问题,直到我用MPDF代替。 –