Adding page title to each page while creating a PDF file using itextsharp in VB.NET
Posted
by
Snowy
on Programmers
See other posts from Programmers
or by Snowy
Published on 2013-10-24T13:43:31Z
Indexed on
2013/10/24
16:08 UTC
Read the original article
Hit count: 412
I have recently started using itextsharp and gradually learning it. So far I created a PDF file and it seems great. I have added a table and some subtables as the first table cells to hold data. It is done using two for loops. The first one loops through all data and the second one is each individual data displayed in columns. The html outcome looks like the following:
<table>
<tr>
<td>Page title in center</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>FirstPersonName</td>
<td>Rank1</td>
<td>info1a</td>
<td>infob</td>
<td>infoc</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>SecondPersonName</td>
<td>Rank2</td>
<td>info1a</td>
<td>infob</td>
<td>infoc</td>
<td>infod</td>
<td>infoe</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>ThirdPersonName</td>
<td>Rank2</td>
<td>info1a</td>
<td>infob</td>
<td>infoc</td>
<td>infod</td>
<td>infoe</td>
<td>infof</td>
<td>infog</td>
</tr>
</table>
</td>
</tr>
</table>
For page headings, I added a cell at the top before any other cells. I need to add this heading to all pages. Depending on the size of data, some pages have two rows and some pages have three rows of data. So I can not tell exactly when the new page starts to add the heading/title. My question is how to add the heading/title to all pages. I use VB.net. I searched for answer online and had no success. Your help would be greatly appreciated.
© Programmers or respective owner