我使用mdpf和php生成PDF。每次使用标记分页符时,我都需要创建不同的页脚。
我的代码是这样的(它不是这样工作的)
$mpdf = new mPDF('c', 'A4');
$mpdf->SetHTMLFooter('First Article','O');
$html = 'Lots of text';
.
.
.
$html .= "pagebreak"; (this is a html tag)
$html .= 'More lots of text';
$mpdf->SetHTMLFooter('Second Article','O');
$mpdf->WriteHTML($html);
print $mpdf->Output();我怎么能这么做?
发布于 2014-11-12 17:15:04
您需要使用WriteHTML刷新内容,然后设置一个新的页脚。
$mpdf = new mPDF('c', 'A4');
$mpdf->SetHTMLFooter('First Article','O');
$html = 'Lots of text';
.
.
.
$html .= "pagebreak"; (this is a html tag)
$mpdf->WriteHTML($html); //flush
$html .= 'More lots of text';
$mpdf->SetHTMLFooter('Second Article','O');
$mpdf->WriteHTML($html);
print $mpdf->Output();https://stackoverflow.com/questions/26168687
复制相似问题