css - 使用 CSS 在 PDF 的每一页中添加页脚文本

标签 css pdf each footer

我需要在 PDF 的每一页中应用页眉和页脚文本,因为我正在使用 CSS 的下面一行。这样我就可以在每一页中应用页眉文本,但不能应用页脚文本。我只在 PDF 的最后一页获得页脚文本。

   @@page {
         @@top {
                content: element(header);
            }

            @@bottom {
                content: element(footer);
            }
        }

        header {
            padding: 10px;
            position: running(header);
            }

     footer {
            padding: 5px;
            position: running(footer);
        } 

最佳答案

#footer {
  position: fixed;
  width: 100%;
  bottom: 0;
  left: 0;
  right: 0;
}

#footer p {
  border-top: 2px solid #555555;
  margin-top:10px;
}
<div id="footer">
  <p>footer text</p>
</div>

关于css - 使用 CSS 在 PDF 的每一页中添加页脚文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30911886/

相关文章:

java - 将 Freemarker 转换为 PDF

pdf - 如何将 RDLC 报告限制为 PDF 中的一页?

pdf - 在单个四开 PDF 输出中创建多页面方向

javascript - jQuery:在每个循环中将对象添加到数组不起作用

javascript - jQuery .live() 和 .each() 与 AJAX 轮询

javascript - 不仅从子函数退出,而且从整个父函数退出

CSS 动画在 Firefox 中不起作用

css - SharePoint 内容编辑器未正确显示页面

css - 使用 css class 在布局中放置 react 组件

javascript - 为什么在点击时从 iframe 中删除属性?