Class PdfTextSearchResult
Represents the full result of a PDF text search operation.
public sealed class PdfTextSearchResult
- Inheritance
-
PdfTextSearchResult
- Inherited Members
Examples
Example: Inspect search results and group matches by page.
using LMKit.Document.Pdf;
PdfTextSearchResult result = await PdfSearch.FindTextAsync("invoice.pdf", "Total");
Console.WriteLine($"File : {result.Path}");
Console.WriteLine($"Query : {result.Query}");
Console.WriteLine($"Pages : {result.ScannedPages} / {result.PageCount}");
Console.WriteLine($"Matches : {result.TotalMatches}");
Console.WriteLine($"Capped : {result.LimitedByMaxMatches}");
var byPage = result.Matches.GroupBy(m => m.PageIndex);
foreach (var group in byPage)
{
Console.WriteLine($" Page {group.Key + 1}: {group.Count()} matches");
}
Constructors
- PdfTextSearchResult(string, string, bool, int, int, int, bool, IReadOnlyList<TextMatch>)
Initializes a new instance of the PdfTextSearchResult class.
Properties
- CaseSensitive
Gets a value indicating whether search was case-sensitive.
- LimitedByMaxMatches
Gets a value indicating whether results were capped by
maxMatches.
- Matches
Gets the returned matches.
- PageCount
Gets the total number of pages in the PDF.
- Path
Gets the absolute path of the searched PDF.
- Query
Gets the search query.
- ScannedPages
Gets the number of scanned pages.
- TotalMatches
Gets the number of returned matches.