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