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.
Asked
Active
Viewed 1,451 times
1 Answers
0
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;
}

Rahul
- 4,294
- 1
- 10
- 12
-
1Thanks for ur response @Rahul, – Ranjana Oct 14 '16 at 10:14
-
1But, I am having different cshtml file for header & using NReco I am printing headers on every page. – Ranjana Oct 14 '16 at 10:15
-
1Like this:HtmlToPdfConverter htmlToPdf = new HtmlToPdfConverter(); htmlToPdf.PageHeaderHtml = htmlHeader; – Ranjana Oct 14 '16 at 10:20
-
@Ranjana, did you find the solution? – Jeeva J Mar 23 '21 at 08:45
-
I am wondering how did you mark this as answer? Did this help you? – Jeeva J Mar 23 '21 at 09:03