How to get bounds of text in pdf?

Hi,

My task is:

  1. Load sample.pdf
  2. Find text “Hello”
  3. Get bound of this “area” like Point1,2,3,4 Left, Right, Top, Bottom, etc

Tell me please how to do that?

Hi,

Use this:

using var document = PdfDocument.Load(desktop + "\\sample.pdf");
var page = document.Pages[0];

var foundText = page.Content.GetText().Find("Hello").FirstOrDefault();
if (foundText != null)
    Console.WriteLine(foundText.Bounds);

Regards,
Mario

Thanks. This is was Solved!