html2pdf page numbering

痴心易碎 提交于 2020-01-14 09:33:29

问题


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?


回答1:


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




回答2:


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

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




回答3:


<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 “;”

Also you have to indicate the size of the header and the footer.




回答4:


Have a look at http://www.tufat.com/docs/html2ps/calling.html and look at the footerhtml parameter.

Also see http://www.tufat.com/docs/html2ps/directives.html for directives you can use.

Hope this points you in the right direction.



来源:https://stackoverflow.com/questions/6386599/html2pdf-page-numbering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!