Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8572463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:01:02+00:00 2026-06-11T19:01:02+00:00

I am developing a C# application in which I am converting a PDF document

  • 0

I am developing a C# application in which I am converting a PDF document to an image and then rendering that image in a custom viewer.

I’ve come across a bit of a brick wall when trying to search for specific words in the generated image and I was wondering what the best way to go about this would be. Should I find the x,y location of searched word?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:01:03+00:00Added an answer on June 11, 2026 at 7:01 pm

    You can use tessract OCR image for text recognition in console mode.

    I don’t know about such SDK for pdf.

    BUT, if you want to get all word coordinates and values, you can use next my not complex code, thank nguyenq for hocr hint:

    public void Recognize(Bitmap bitmap)
    {
        bitmap.Save("temp.png", ImageFormat.Png);
        var startInfo = new ProcessStartInfo("tesseract.exe", "temp.png temp hocr");
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        var process = Process.Start(startInfo);
        process.WaitForExit();
    
        GetWords(File.ReadAllText("temp.html"));
    
        // Futher actions with words
    }
    
    public Dictionary<Rectangle, string> GetWords(string tesseractHtml)
    {
        var xml = XDocument.Parse(tesseractHtml);
    
        var rectsWords = new Dictionary<System.Drawing.Rectangle, string>();
    
        var ocr_words = xml.Descendants("span").Where(element => element.Attribute("class").Value == "ocr_word").ToList();
        foreach (var ocr_word in ocr_words)
        {
            var strs = ocr_word.Attribute("title").Value.Split(' ');
            int left = int.Parse(strs[1]);
            int top = int.Parse(strs[2]);
            int width = int.Parse(strs[3]) - left + 1;
            int height = int.Parse(strs[4]) - top + 1;
            rectsWords.Add(new Rectangle(left, top, width, height), ocr_word.Value);
        }
    
        return rectsWords;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im developing an application,which blocks all outgoing calls and then after blocking that call
I am developing an Android application which needs an image to be transmitted from
I am developing application which has camera functionality. i want to save that captured
I have heard that when developing application which uses a database you should do
I developing a application which read the NFC Tag details.. In that application i
I am developing application which is having Gujarati font in text-view but my problem
When developing an application which mostly interacts with a database, what is a good
I`m developing an application which receives data from my GPS device like coordinates, speed
We are developing an application which is read heavy and could possibly have millions
I am developing an application which needs to connect to an embedded bluetooth device,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.