Home : Extract Text from a Pdf Document
Q10291 - HOWTO: Extract Text from a Pdf Document

The PdfTextDocument class is the base class for extracting searchable text from an existing pdf file. Below is a method showing how to extract an entire page of text from the pdf file:

C#

using (PdfTextDocument doc = new PdfTextDocument(docpath))

{

    PdfTextPage page = doc.GetPage(0);

    string s = page.GetText(0, page.CharCount);

    MessageBox.Show(s);

}

 

VB.NET

Using doc As New PdfTextDocument(docpath)

    Dim page As PdfTextPage = doc.GetPage(0)

    Dim s As String = page.GetText(0, page.CharCount)

    MessageBox.Show(s)

End Using

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved