I have to retrieve text from PDF file. But using the following code I only get empty text file.
for (int i = 0; i < n; i++)
{
pagenumber = i + 1;
For text extraction with iTextSharp, take a current version of that library and use
PdfTextExtractor.GetTextFromPage(reader, pageNumber);
Beware, there is a bug in the text extraction code in some 5.3.x version which has meanwhile been fixed in trunk. You, therefore, might want to checkout the trunk revision.