tags:

views:

56

answers:

2

I am using iText library for writing a PDF file. I want to give page numbers and page header on every page of file How can I do that?

A: 

If you don't break lines manually then it's really hard almost impossible to precisely get the line count. This number depends on font measurement and the text layout on a page. iText is a great tool for PDF generation not for parsing.

Boris Pavlović
A: 

I suggest you buy the iText book "iText in Action" which is very helpful. If you don't generate your page breaks yourself, you could checkout the PdfPageEvent methods such as onStartPage() and the getPageNumber() method.

Jaydee