首页 > 解决方案 > 将HTML转换为PDF时如何在每页底部添加页脚

问题描述

我正在将我的 HTML 转换为 PDF 报告。我希望页脚显示在最后一页的底部,即使该页面上只有一行文本。你能帮忙吗?

我正在使用 wkhtmltopdf 工具来转换文件。我已经搜索了很多,我能找到的唯一解决方案是:

    body{
    position:releative;
    }
    
    footer{
    position:absolute;
    bottom:0;
    right:0;
    float:right;
    }

这会在第一页的底部生成一个页脚。

谢谢 !

标签: javascripthtmlcssangularwkhtmltopdf

解决方案


我建议您可以使用 tcpdf。试试这个https://tcpdf.org/examples/example_003/


推荐阅读