php html2pdf页码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6386599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
html2pdf page numbering
提问by Marcin Zaremba
I have code like this:
我有这样的代码:
$html2pdf = new HTML2PDF('P','A4','en');
$html2pdf->WriteHTML($html);
$html2pdf->Output();
How add page number at the bottom of the document?
如何在文档底部添加页码?
回答by pit
i'm still looking for it ... and i have just found the solution : in your template, insert a code like :
我仍在寻找它......我刚刚找到了解决方案:在您的模板中,插入如下代码:
<page>
<page_footer>
[[page_cu]]/[[page_nb]]
</page_footer>
</page>
complete sample here : http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:bookmark
完整示例:http: //wiki.spipu.net/doku.php?id=html2pdf: en: v4: bookmark
回答by Dinesh Patra
I tried the following code.
我尝试了以下代码。
<page>
<page_header footer='page'>
<!-- some text-->
</page_header>
<!--
Content
-->
<page_footer>
</page_footer>
</page>
Now in each page in footer I am getting PAGE NUMBER IN THE FOLLOWING MANNER
现在,在页脚的每一页中,我都按照以下方式获得了页码
Page 1/3 Page 2/3 Page 3/3
第 1/3 页 第 2/3 页 第 3/3 页
But i have not got any custom format. If any body know please tell.
但我没有任何自定义格式。如果任何机构知道请告诉。
I have followed the link : http://wiki.spipu.net/doku.php?id=html2pdf%3aen%3av4%3apage
我已经按照链接:http: //wiki.spipu.net/doku.php?id=html2pdf%3aen%3av4%3apage
回答by mohamet monte
<page backtop="7mm" backbottom="7mm" footer="page">
<page_header>
<!-- some text-->
</page_header>
<!--
Content
-->
<page_footer>
</page_footer>
Instance on de page which type of option do you want on the page. Diferents options are : (page, date, heure, form), separated by “;”
在页面上实例您希望在页面上使用哪种类型的选项。不同的选项是:(页面,日期,heure,表单),以“;”分隔
Also you have to indicate the size of the header and the footer.
您还必须指出页眉和页脚的大小。
回答by Arno
Have a look at http://www.tufat.com/docs/html2ps/calling.htmland look at the footerhtml
parameter.
看看http://www.tufat.com/docs/html2ps/calling.html并查看footerhtml
参数。
Also see http://www.tufat.com/docs/html2ps/directives.htmlfor directives you can use.
另请参阅http://www.tufat.com/docs/html2ps/directives.html了解您可以使用的指令。
Hope this points you in the right direction.
希望这为您指明了正确的方向。