2

我有一个 html 代码,当我使用 html2pdf 将其转换为 pdf 时,它比单个页面长,我需要在两个页面中都输入页码。

我试过把 page_footer 代码放在这篇文章中说的那样:html2pdf page numbering

但它只显示最后一页的页码,而不是第一页。我可以修改html代码,但我明白如果我把标签放在它的末尾,html2pdf认为它指的是代码的末尾,而不是页面的末尾。

如何将页码放在所有页面中,从第一页到最后一页?

谢谢你!

4

1 回答 1

3

You can put the attribute footer="page" in the <page> tag and all the pages will be auto-numbered.

<page footer="page">
    <page_header>
        /* Page Header */
    </page_header> 
    <page_footer>
        /* Page Footer */
    </page_footer>

    /* Page Content */
</page>

html2pdf:en:v4:page

于 2013-05-15T07:45:37.547 回答