gpt4 book ai didi

html - 使用 docraptor : How to flow header logo on every page and fix footer on the first page of pdf. 打印 css 媒体

转载 作者:行者123 更新时间:2023-11-28 01:22:23 25 4
gpt4 key购买 nike

我正在尝试制作一个在线表格,其中包含页眉(带有公司 Logo )和页脚(具有三个不同的地址)。 body 里有很多东西。我需要在表单的每一页都显示页眉 Logo ,但我只需要在第一页而不是每一页上修复页脚。

我正在使用的标题 Logo @page { @top {内容:流(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 支持发送电子邮件。 :)

关于html - 使用 docraptor : How to flow header logo on every page and fix footer on the first page of pdf. 打印 css 媒体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33473555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com