【发布时间】:2017-03-01 09:55:29
【问题描述】:
我正在尝试使用 TCPDF 生成 PDF。我需要它有一个包含一些信息和背景图像的标题。背景图像的主要目的是充当水印。
标题工作得很好。但是,当我添加背景图像时,标题消失了。
这里是Header函数代码:
public function Header(){
$html = '
<table>
<tr>
<td style="font-weight: bold;font-size: 8px;">PlayGround Name </td>
<td></td>
<td style="font-weight: bold;font-size: 8px;">'.date('d-m-Y').'</td>
<td></td>
<td style="font-weight: bold;font-size: 8px;">Page 1/1 </td>
</tr>
</table>
';
$this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'top', $autopadding = true);
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = base_url().'assets/images/demo.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
我想要标题和背景图片。 任何帮助表示赞赏...
【问题讨论】:
标签: php codeigniter tcpdf