I want to find a text and change the fore color of that text.
I have been trying the below code but it doesnot change.
Spire.Pdf.General.Find.PdfTextFind[] text2 = page2.FindText("<PLACE1>", TextFindParameter.WholeWord).Finds;
PdfBrush brush = new PdfSolidBrush(Color.DarkBlue);
RectangleF rec;
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", 12f, FontStyle.Regular));
foreach (Spire.Pdf.General.Find.PdfTextFind seletion in text2)
{
rec = seletion.Bounds;
page2.Canvas.DrawRectangle(PdfBrushes.White, rec);
page2.Canvas.DrawString("<PLACE1>", font, brush, rec);
}
I have tried to apply highlight and that also doesnot work.
Please help.
Thank you