Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
I want to convert a string made of html & css into pdf.
I have done that, My problem is that pdf doesn't repeat the table header in every page, my clients wants this.
I need to repeat table header in every page and at the end of every page, there should be proper ending horizontal line.

What I have tried:

I have tried thead{display: table-header-group;}
also tried different c# code but result was same.
Posted
Updated 15-Nov-16 2:05am
Comments
Kornfeld Eliyahu Peter 15-Nov-16 5:05am    
So you do not want to convert HTML to PDF, but PRINT! HTML to PDF... Search solutions along that line!
Sinisa Hajnal 15-Nov-16 6:24am    
Either have those headers added to your HTML or use one of many reporting tools and create report that will take the data without any need for html formatting. CrystalReports, FastReports, MS Report Builder and others are easily available.

1 solution

If you are using itextsharp to generate PDF, and adding PdfPTable to iTextSharp.text.Document
Use below line, this will create header row on each page while generating PDF
PdfPTable.HeaderRows = 1;
 
Share this answer
 
Comments
Er.D.K.Malhotra 15-Nov-16 23:28pm    
Thanks bro...but iTextSharp doesn't take css. I have many css class that is applied to the html tags while generating pdf

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900