ByteScout Premium Suite - VBScript - Find hyphenated text in pdf with pdf extractor sdk - ByteScout

ByteScout Premium Suite – VBScript – Find hyphenated text in pdf with pdf extractor sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Find hyphenated text in pdf with pdf extractor sdk

How to find hyphenated text in pdf with pdf extractor sdk in VBScript with ByteScout Premium Suite

Learning is essential in computer world and the tutorial below will demonstrate how to find hyphenated text in pdf with pdf extractor sdk in VBScript

An easy to understand sample source code to learn how to find hyphenated text in pdf with pdf extractor sdk in VBScript ByteScout Premium Suite can find hyphenated text in pdf with pdf extractor sdk. It can be applied from VBScript. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

The following code snippet for ByteScout Premium Suite works best when you need to quickly find hyphenated text in pdf with pdf extractor sdk in your VBScript application. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Applying VBScript application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

ByteScout Premium Suite free trial version is available on our website. VBScript and other programming languages are supported.

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

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

FindTextAndGetCoordinates.vbs
      
' Create Bytescout.PDFExtractor.TextExtractor object Set extractor = CreateObject("Bytescout.PDFExtractor.TextExtractor") extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Load sample PDF document extractor.LoadDocumentFromFile("..\..\words-with-hyphens.pdf") ' Set the matching mode: ' 0 = WordMatchingMode.None - treats the search string as substring; ' 1 = WordMatchingMode.SmartMatch - will find the word in various forms (like Adobe Reader); ' 2 = WordMatchingMode.ExactMatch - treats the search string as separate word. extractor.WordMatchingMode = 1 ' Get page count pageCount = extractor.GetPageCount() For i = 0 To PageCount - 1 If extractor.Find(i, "hyphen", false) Then ' parameters are: page index, string to find, case sensitivity. Do foundMessage = "Found substring 'hyphen' on page #" & CStr(i) & " at { " & _ "x = " & CStr(extractor.FoundText.Left) & "; " & _ "y = " & CStr(extractor.FoundText.Top) & "; " & _ "width = " & CStr(extractor.FoundText.Width) & "; " & _ "height = " & CStr(extractor.FoundText.Height) & " }" elementInfo = "" ' Iterate through elements of the found text object For j = 0 to extractor.FoundText.ElementCount - 1 Set element = extractor.FoundText.GetElement(j) elementInfo = elementInfo & "Element #" & CStr(j) & " at { x = " & CStr(element.Left) & "; y = " & CStr(element.Top) & "; width = " & CStr(element.Width) & "; height = " & CStr(element.Height) & vbCRLF elementInfo = elementInfo & "Text: " & CStr(element.Text) & vbCRLF elementInfo = elementInfo & "Font is bold: " & CStr(element.FontIsBold) & vbCRLF elementInfo = elementInfo & "Font is italic: " & CStr(element.FontIsItalic) & vbCRLF elementInfo = elementInfo & "Font name: " & CStr(element.FontName) & vbCRLF elementInfo = elementInfo & "Font size: " & CStr(element.FontSize) & vbCRLF elementInfo = elementInfo & "Font color (as OLE_COLOR): " & CStr(element.FontColorAsOleColor) & vbCRLF & vbCRLF Next WScript.Echo foundMessage & vbCRLF & vbCRLF & elementInfo Loop While extractor.FindNext End If Next WScript.Echo "Done" Set extractor = Nothing

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