Working with PdfTextReader Class
The PdfTextReader class is used to extract text content from pdf documents. It inherits from TextReader class, so you can use it just like an ordinary StreamReader, just feed it with pdf document, then you can use methods such as Read(), ReadLine() to read text from it.
The following examples extract all text content from file1.pdf and print them on screen:
[C#]
PdfTextReader reader = new PdfTextReader("file1.pdf");
string strLine = null;
while ((strLine = reader.ReadLine()) != null)
{
Console.WriteLine(strLine);
}
reader.Close();
[VB.NET]
Dim reader As New PdfTextReader("file1.pdf")
Dim strLine As String
While (strLine = reader.ReadLine()) <> NULL
Console.WriteLine(strLine);
End While