【发布时间】:2019-04-04 17:34:24
【问题描述】:
我正在制作一个转换为 PDF 的页面。此 PDF 将有多页长。我想在生成的 PDF 的最后一页底部添加一些文本内容,例如条款和条件。
目前我使用的是.footer,但这会在每一页的底部打印文本。
<HTML>
<head>
<style>
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
clear:both;
}
</style>
</head>
<body>
<div>
Main content
</div>
<div class="footer">
Footer Content. I want this to be only on the last page.
</div>
</body>
</HTML>
【问题讨论】:
-
您是否使用浏览器的打印方式创建PDF?
-
为最后一页内容制作一个带有页脚的模板 - 如果内容是固定的。
-
您如何“打印到 PDF”?您是否尝试过 CSS 媒体查询。特别是“印刷”媒体类型。