News & Releases

Minimize
Nasosoft Component for .NET v3.8.0 Released - Wednesday, January 19, 2011

Nasosoft Component for .NET v3.8.0 has released with many improvements.

Nasosoft Component for .NET is a suite of comprehensive .NET controls, including EXCEL, PDF, and RTF document format engines, RTF to HTML, HTML to RTF, RTF to TEXT, HTML to TEXT document transform engines and ZIP, GZIP, TAR compression.

What's new

  • Nasosoft Transform
    • Support iFilter COM+ interfaces 
    • Convert different documents to Text with iFilter

 How to Download

 

PdfTextReader

   Minimize

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

reader.Close()