javascript - 将HTML转换为PDF时如何在每页底部添加页脚
问题描述
我正在将我的 HTML 转换为 PDF 报告。我希望页脚显示在最后一页的底部,即使该页面上只有一行文本。你能帮忙吗?
我正在使用 wkhtmltopdf 工具来转换文件。我已经搜索了很多,我能找到的唯一解决方案是:
body{
position:releative;
}
footer{
position:absolute;
bottom:0;
right:0;
float:right;
}
这会在第一页的底部生成一个页脚。
谢谢 !
解决方案
我建议您可以使用 tcpdf。试试这个https://tcpdf.org/examples/example_003/
推荐阅读
- postgresql - PostgreSql如何声明变量类型列表
- javascript - 这些规则对 reactjs 架构级别有效吗?
- python-3.x - 使用 Python 使用 kubernetes-client 在 Kubernetes pod 中连接到 MongoDB
- javascript - 用 JsPDF 替换 VirtualPrintEngine
- npm - NPM 配置文件在哪里?
- snakemake - Snakemake表格配置、展开、合并——如何正确展开输入文件?
- python - Python 打印我的类对象内存地址而不是我的数组的值
- php - 为什么事件监听器没有在 Lumen 中触发?
- arduino - 如果客户端重新连接,如何抑制 MQTT Last Will 消息?
- multithreading - 使用 Start-Process 时 Invoke-Parallel 正在等待