Hello David Noe,
Thanks for your message.
I did an initial test with our latest
Spire.PDF Pack(Hot Fix) Version:8.7.2, but I didn't reproduce your issue. If you were using an old version, I suggest that you upgrade to the latest one to try again. Besides, the method has some adjustments in our latest version, please use the following sample code to test.
If there is still any question, please share us with your input PDF file for further testing.
- Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(@"input.pdf");
PdfTextFind[] result = null;
foreach (PdfPageBase page in pdf.Pages)
{
//old method
//result = page.FindText("sex", true, true).Finds;
result = page.FindText("sex",TextFindParameter.IgnoreCase| TextFindParameter.WholeWord).Finds;
foreach (PdfTextFind find in result)
{
find.HighLight();
}
}
string output = @"out.pdf";
pdf.SaveToFile(output, FileFormat.PDF);
Sincerely,
Simple
E-iceblue support team