Is there a way to set different headers on different pages using NReco.Pdf Generator C#?

雨燕双飞 提交于 2019-12-12 03:42:59

问题


We are having different templates for PDF Headers and Body respectively. Now we want different Headers on different pages. We are converting HTML to PDF using NReco and version is 1.1.12.


回答1:


you can use some thing like this
now u just need to set class to ur headers parent element like i did here

to print p1-header add class p1, to print p2-header add class p2 to its container on that particular page

<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; 
}


来源:https://stackoverflow.com/questions/40024115/is-there-a-way-to-set-different-headers-on-different-pages-using-nreco-pdf-gener

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!