we have a feature to search text in header, footer or in the whole PDF. Here is part of our code:
- Code: Select all
var options = new PdfTextFindOptions();
options.Parameter = Spire.Pdf.Texts.TextFindParameter.IgnoreCase;
foreach (PdfPageBase page in MasterDocument.Pages)
{
var finder = new PdfTextFinder(page);
finder.Options = options;
var finds = finder.Find(pattern);
if (finds.Count > 0)
pages.Add(page);
}
This works fine if the text we search in on one line but doesn't work if it is on separate lines.
Adele, Bono and Madonna were successfully found, but Jimmy Page and Mick Jagger were not.
Pls, referee to the attached example pdf.
We use Spire Office for .NET to v. 8.6.0.
Regards