Click or drag to resize
Pdf Library for .NET

PdfToTextSearch(String) Method

Searches the document for the given text (case-insensitive substring match) and returns the bounding rectangle of every occurrence.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public TextPosition[] Search(
	string textToSearch
)

Parameters

textToSearch  String
The text to search for.

Return Value

TextPosition
The position of every occurrence found; an empty array when there are none.
Example
PdfToText tool = new PdfToText();
tool.Load("document.pdf");
TextPosition[] hits = tool.Search("total");
foreach (TextPosition p in hits)
    System.Console.WriteLine("page " + p.PageNumber + " at " + p.X + "," + p.Y);
tool.Close();
See Also