我使用 docraptor API 生成 PDF,我的 pdf 可以有多个页面。我已经为 pdf 设置了标题图像,但它出现在所有页面上。我只需要第一页的标题。
TIA
Lector 的答案在这种情况下肯定会起作用,但不同页面上的标题可能会有所不同。
Prince(DocRaptor 的 PDF 渲染器)命名页面部分提供了完整的文档,但大致如下所示:
<style type="text/css">
@page has-header {
@top {
content: "This is header of text";
}
}
.first-page {
page: has-header;
/* all content within .first-page will use the above @page styling */
}
</style>
<div class="first-page">
Put first page content here
</div>
<p>Rest of content will not have a header.</p>
这种模式可以重复。不同的命名页面可以有不同的页眉、不同的边距、不同的横向/纵向模式、大小等。
您能否将其设置为文档开头的正常内容,而不是在每一页上重复的标题?