PDF to PNG - pqScan.com
.NET PDF to Text SDK Use Superior .NET SDK to Extract Text from PDF and Export PDF to Text Format Download Trial Purchase Now

How to Extract Text from PDF in VB.NET

back to home  >  .NET PDF to Text SDK  >  How to Extract Text from PDF in .NET  >  PDF to Text Extraction Using VB.NET

In a PDF document, text content is always the main component. And extracting text from PDF file is a strong demand in document management industry, especially for .NET windows and web programming applications. Here, in this article, you will find how easy to meet this demand using VB.NET programming language.

With the help of pqScan .NET PDF to Text Converter SDK, powerful and professional PDF document manipulation toolkit, VB.NET developers can easily use Visual Basic code to extract PDF document text or convert PDF to plain text file. PDF document in various western languages is supported, such as English, French, Spanish, Chinese and so on.

How to: PDF to Text in VB.NET

By using specific .NET APIs, programmers can implement fast PDF to text extraction and PDF to text conversion in VB.NET application. Moreover, VB.NET programmers can export text in two ways. Now, let's start. Please firstly download free .NET PDF to Text Extraction Software online, integrate PQScan.PDFToText.dll into VB.NET project, and add the following free demo code to your project.

Extract PDF to String Object

You are able to get PDF file plain text and export it in String Object. Please directly use the following VB.NET sample code for free evaluation.

Imports System.Text
Imports PQScan.PDFToText

Namespace PDF2Text
  Class Program
    Private Shared Sub Main(args As String())
      ' Create an instance of PQScan.PDFToText.PDFExtractor object.
      Dim extractor As New PDFExtractor()

      ' Load a PDF document to VB.NET project.
      extractor.LoadPDF("sample.pdf")

      ' Get total page count.
      Dim count As Integer = extractor.PageCount

      For i As Integer = 0 To count - 1
        ' Get text from each PDF document page.
        Dim pageText As String = extractor.ToText(i)
        Console.WriteLine(pageText)
      Next

      ' Get text from whole PDF document.
      Dim totalText As String = extractor.ToText()
      Console.WriteLine(totalText)
    End Sub
  End Class
End Namespace

Convert PDF to Text File

The other way to export PDF document is creating text file. VB.NET developers can use mature API to implement text recognition from whole PDF and convert PDF to plain text format. Simply achieve these functions by using following free VB.NET programming demo. To see more related online tutorials, please refer to left navigation bar.

Imports System.Text
Imports PQScan.PDFToText

Namespace PDF2TextFile
  Class Program
    Private Shared Sub Main(args As String())
      ' Create an instance of PQScan.PDFToText.PDFExtractor object.
      Dim extractor As New PDFExtractor()

      ' Load a PDF file.
      extractor.LoadPDF("sample.pdf")

      ' Change whole PDF plain text to txt file.
      extractor.ToTextFile("output-text.txt")
    End Sub
  End Class
End Namespace
pqScan SDK
.NET PDF to Text Extractor
Online Guide
Extract PDF Text in .NET Extract PDF Text in C# Extract PDF Text in ASP.NET
With the help of your software, I finished my project nearly half the time. Really appreciate your timely support - thank you so much! Jon Gurbuz