- Code: Select all
string[] keyArray = new string[] { "text1", "text2", "text3" };
for(int i=0;i<keyArray.Count();i++)
{
PdfTextFind[] resultSum = page.FindText(keyArray[i]).Finds;
for(int j=0;j<resultSum.Count();j++)
{
PdfTextFind result = resultSum[j];
if (result != null)
{
RectangleF rectangleF = result.Bounds;
PdfPen pen = new PdfPen(PdfBrushes.Black, 1f);
PdfBrush brush = PdfBrushes.Red;
page.Canvas.DrawRectangle(pen, brush, rectangleF);
}
}
}
I want the text to be covered by color blocks,but only text that is in the same direction as the page coordinate system is properly overwritten.They have the same bottom left coordinate,what should I do?
Best regards
WangZhiYu