ByteScout PDF Extractor SDK - C# - Find Text With Hyphens - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – C# – Find Text With Hyphens

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Find Text With Hyphens

ByteScout PDF Extractor SDK – C# – Find Text With Hyphens

Program.cs

using System;
using System.Drawing;
using Bytescout.PDFExtractor;

namespace FindText
{
class Program
{
static void Main(string[] args)
{
// Create Bytescout.PDFExtractor.TextExtractor instance
TextExtractor extractor = new TextExtractor();
extractor.RegistrationName = “demo”;
extractor.RegistrationKey = “demo”;

// Load sample PDF document
extractor.LoadDocumentFromFile(“words-with-hyphens.pdf”);

int pageCount = extractor.GetPageCount();

for (int i = 0; i < pageCount; i++) { // Search each page for "hyphen" string if (extractor.Find(i, "hyphen", false)) { do { Console.WriteLine("Found on page " + i + " at location " + extractor.FoundText.Bounds.ToString()); } while (extractor.FindNext()); } } // Cleanup extractor.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadLine(); } } } [/csharp]


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next