[英]css media print using docraptor: How to flow header logo on every page and fix footer on the first page of pdf.
我正在尝试制作一个在线表格,它有页眉(带有公司标志)和页脚(带有三个不同的地址)。 在身体里有很多东西。 我需要在表单的每一页中流动页眉标志,但我只需要在第一页上而不是在每一页上修复我的页脚。
对于标题徽标,我正在使用 @page { @top {content: flow(page_header); }} 。
但是当我对页脚使用相同的东西时,它不起作用。 有人可以帮我解决这个问题吗?
注意:我正在使用 docraptor 将 html 转换为 pdf。
DocRaptor 的开发人员在这里。 您可以使用一些简单的 CSS 来做到这一点。 这是一个完整的演示示例:
<!DOCTYPE html>
<html>
<head>
<style>
h1 { flow: static(page_header); }
h2 { flow: static(first_page_footer); }
@page {
@top { content: flow(page_header); }
}
@page:first {
@bottom { content: flow(first_page_footer); }
}
hr { page-break-after: always; }
</style>
</head>
<body>
<h1>Header Content</h1>
<h2>Footer Content</h2>
<p>Page 1 content.</p>
<hr />
<p>Page 2 content.</p>
</body>
</html>
希望有帮助! 如果您遇到任何不同的问题或想打个招呼,请发送电子邮件给 DR 支持。 :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.