我正在使用html2pdf动态生成PDF页面,每件事情都按预期完美运行,但是在我决定显示页码并在页面标记中添加了backtop =“7mm”属性后,它显示一个空页面在大多数情况下。
我不确定避免此错误的最佳方法是什么,我生成PDF的方式有什么不对吗?
以下是生成的PDF链接。 http://lovewithbug.com/downloads/mypdf.pdf
链接到打印$ order->字母的HTML字母正在生成http://lovewithbug.com/downloads/letter.html(忽略此处的不同签名)
我用来生成PDF的代码是。
<page backtop="7mm">
<page_header>
<div style="width:730px; text-align:right;"><?php echo $order->order_id;?> page [[page_cu]] of [[page_nb]]</div>
</page_header>
<div style="width:700px; margin-left:30px; margin-right:30px; padding:0;">
<table style="width:700px;" cellpadding="0" cellspacing="0">
<tr>
<td style="width:250px;height:175px;" valign="top" align="left">
<?php echo $img_logo;?>
</td>
<td align="left" style="width:450px;font-size:16px; text-align:left; padding-left:25px; " valign="middle"><strong>URGENT: PLEASE RESPOND IMMEDIATLEY</strong> </td>
</tr>
</table>
<br style="height:1px;" />
<table width="500" align="left" cellpadding="0" cellspacing="0" style="margin:37px 0 0 0; width:400px; padding:0;">
<tr>
<td width="151" valign="top" style="font-size:16px; width:127px; vertical-align:top; text-align:left; text-transform:uppercase;">
<div style="text-align:center;">
<strong>
CONFIDENTAIL<br />
<?php echo date("F d"); ?><br />
<?php echo date("Y");?>
</strong>
</div>
</td>
<td width="247" align="left" valign="top" style="font-size:13px; text-align:left; margin:0 0 0 10px;">
<?php echo (!empty($order->customer))?$order->customer.'<br />':''; ?>
<?php echo (!empty($order->stress_address))?$order->stress_address.'<br />':''; ?>
<?php echo (!empty($order->unit))?$order->unit.'<br />':''; ?>
<?php echo (!empty($order->town))?$order->town.' ':''; ?>
<?php echo (!empty($order->state))?$order->state.' ':''; ?>
<?php echo (!empty($order->zip_code))?$order->zip_code.'<br />':''; ?>
</td>
</tr>
</table>
<div style="margin:70px 0 0 0;"> <div style="background-color:#000; width:700px; height:1px;" ></div> </div>
<?php print ($order->letter); ?>
</div>
</page>