How To Add Header In Pdf Using Itextsharp In C#

/ Comments off
  1. See More On Stackoverflow
  2. How To Add Header In Pdf

I used a a very simple approach to add a header row on each page, when creating a PdfPTable with 'n' rows, where 'n' could any integer. I am using iTextSharp 4.0.4.0. So, you could create a table with 1000 rows or 2 rows or 5000 rows, but iTextSharp will automatically page the output for you. What iTextSharp will not do is automatically add a header to start of every page. In order to add a header row for every page, all I did was add the single line of code after creating the PdfPTable with all its rows and cells, and then iTextSharp automatically paged the output with a header row.

Give more feedback

See More On Stackoverflow

Free windows 7 patch download. In this blog we will learn how to create tables in PDF using C# and iTextSharp. Hello, I am creating a pdf file using itextsharp. I want to add header and footer for each page in the pdf document. Can anyone tell me how can I do this?

How To Add Header In Pdf

'table' is the instance of PdfPTable that I created in my code before setting its HeaderRows property. Table.HeaderRows = 1; //this will automatically insert a header row //at start of every page. The first row you created //in your code will be used as the header row in this case.