是否有一种方法来设置不同的页头使用nrecof . pdf生成器c#

本文关键字:nrecof pdf 一种 设置 方法 是否 | 更新日期: 2023-09-27 18:13:00

我们分别有不同的PDF标题和正文模板。现在我们希望在不同的页面上有不同的header。我们正在使用NReco将HTML转换为PDF,版本为1.1.12。

是否有一种方法来设置不同的页头使用nrecof . pdf生成器c#

你可以这样写
现在你只需要将class设置为header的父元素就像我在这里所做的那样

将p2类添加到对应页面的容器中

<header class="p1">
    // this p1-header will be visible only rest will hide
    <h1 class="p1-header">some text p1</h1>
    <h1 class="p2-header">some text p2</h1>
    <h1 class="p3-header">some text p3</h1>
</header>
.p1-header, .p2-header, .p3-header{
    display: none;
}
.p1 .p1-header{
    display: block; 
}
.p2 .p2-header{
    display: block; 
}
.p3 .p3-header{
    display: block; 
}