The sample shows instructions and algorithm of how to extract text from page area in pdf with pdf extractor sdk and how to make it run in your VB.NET application. ByteScout Data Extraction Suite is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can be applied to extract text from page area in pdf with pdf extractor sdk using VB.NET.
This prolific sample source code in VB.NET for ByteScout Data Extraction Suite contains various functions and other necessary options you should do calling the API to extract text from page area in pdf with pdf extractor sdk. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Want to see how it works with your data then code testing will allow the function to be tested and work properly.
Our website gives trial version of ByteScout Data Extraction Suite for free. It also includes documentation and source code samples.
Imports System.Drawing Imports Bytescout.PDFExtractor Class Program Friend Shared Sub Main(args As String()) ' Create Bytescout.PDFExtractor.TextExtractor instance Dim extractor As New TextExtractor() extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Load sample PDF document extractor.LoadDocumentFromFile("sample2.pdf") ' Get page count Dim pageCount As Integer = extractor.GetPageCount() ' Iterate through pages For i As Integer = 0 To pageCount - 1 ' Define rectangle location to extract from Dim location As RectangleF = New RectangleF(0, 0, 200, 200) ' Set extraction area extractor.SetExtractionArea(location) ' Extract text from the extraction area Dim text As String = extractor.GetTextFromPage(i) Console.WriteLine("Extracted from page #" + i.ToString() + ":") Console.WriteLine() Console.WriteLine(text) ' Reset the extraction area extractor.ResetExtractionArea() Console.WriteLine() Next ' Cleanup extractor.Dispose() Console.WriteLine("Press any key to exit...") Console.ReadKey() End Sub End Class