I have issue using spire.pdf.dll library to draw rectangle on pdf document.
I am seaching for text "7754235-00" on pdf document and drawing rectangle around that text.
On 3 different computers I get 3 different results, see attached.
Do you know what might be causing this issue, e.g. can some settings on operating system affect this?
I am using this code:
- Code: Select all
foreach (PdfPageBase page in pdf.Pages)
{
PdfTextFindCollection findTextCollection = page.FindText("7754235-00", TextFindParameter.WholeWord);
PdfTextFind textFind = findTextCollection.Finds[0];
PdfPen pen = new PdfPen(color, 0.7f);
RectangleF rectangle = textFind.TextBounds[0];
PdfGraphicsState state = page.Canvas.Save();
page.Canvas.DrawRectangle(pen, rectangle);
page.Canvas.Restore(state);
}