ByteScout Premium Suite - VB.NET - Find text in pdf with pdf extractor sdk - ByteScout

ByteScout Premium Suite – VB.NET – Find text in pdf with pdf extractor sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VB.NET – Find text in pdf with pdf extractor sdk

How to find text in pdf with pdf extractor sdk in VB.NET with ByteScout Premium Suite

Continuous learning is a crucial part of computer science and this tutorial shows how to find text in pdf with pdf extractor sdk in VB.NET

The code displayed below will guide you to install an VB.NET app to find text in pdf with pdf extractor sdk. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can find text in pdf with pdf extractor sdk in VB.NET.

This prolific sample source code in VB.NET for ByteScout Premium Suite contains various functions and other necessary options you should do calling the API to find text 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! Further improvement of the code will make it more robust.

If you want to try other source code samples then the free trial version of ByteScout Premium Suite is available for download from our website. Just try other source code samples for VB.NET.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
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(".\sample1.pdf") ' Set the matching mode. ' WordMatchingMode.None - treats the search string as substring; ' WordMatchingMode.ExactMatch - treats the search string as separate word; ' WordMatchingMode.SmartMatch - will find the word in various forms (like Adobe Reader). extractor.WordMatchingMode = WordMatchingMode.ExactMatch Dim pageCount As Integer = extractor.GetPageCount() For i As Integer = 0 To pageCount - 1 ' Search each page for "ipsum" string If extractor.Find(i, "ipsum", False) Then Do Console.WriteLine("") Console.WriteLine(("Found on page " & i & " at location ") + extractor.FoundText.Bounds.ToString()) Console.WriteLine("") ' Iterate through each element in the found text For Each element As SearchResultElement In extractor.FoundText.Elements Console.WriteLine((((("Element #" + element.Index.ToString() & " at left=") + element.Left.ToString() & "; top=") + element.Top.ToString() & "; width=") + element.Width.ToString() & "; height=") + element.Height.ToString()) Console.WriteLine("Text: " + element.Text) Console.WriteLine("Font is bold: " + element.FontIsBold.ToString()) Console.WriteLine("Font is italic:" + element.FontIsItalic.ToString()) Console.WriteLine("Font name: " + element.FontName) Console.WriteLine("Font size:" + element.FontSize.ToString()) Console.WriteLine("Font color:" + element.FontColor.ToString()) Next Loop While extractor.FindNext() End If Next ' Cleanup extractor.Dispose() Console.WriteLine() Console.WriteLine("Press any key to continue...") Console.ReadLine() End Sub End Class

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next