 |
PdfToTextSearch(String) Method |
Searches the document for the given text (case-insensitive substring match) and returns the
bounding rectangle of every occurrence.
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntaxpublic TextPosition[] Search(
string textToSearch
)
Public Function Search (
textToSearch As String
) As TextPosition()
Parameters
- textToSearch String
- The text to search for.
Return Value
TextPositionThe position of every occurrence found; an empty array when there are none.
ExamplePdfToText 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();Dim tool As New PdfToText()
tool.Load("document.pdf")
Dim hits As TextPosition() = tool.Search("total")
For Each p As TextPosition In hits
System.Console.WriteLine("page " & p.PageNumber & " at " & p.X & "," & p.Y)
Next
tool.Close()
See Also