Return to site

How to highlight a pdf file

broken image

Use the PdfTextSearchResults.Rectangles property to access the document areas that contain search text. Graphics.AddToPageForeground(result.Page, 72, 72)Ĭall the PdfDocumentProcessor.AddTextMarkupAnnotation method to add an annotation to the search results. Public Shared Sub HighlightResult(ByVal graphics As PdfGraphics, ByVal result As PdfTextSearchResults, ByVal brush As SolidBrush)įor i As Integer = 0 To - 1ĭim rect As New RectangleF(New PointF(CSng(result.Rectangles(i).Left), CSng() - CSng(result.Rectangles(i).Top)), New SizeF(CSng(result.Rectangles(i).Width), CSng(result.Rectangles(i).Height)))

broken image

Graphics.AddToPageForeground(result.Page, 72, 72) RectangleF rect = new RectangleF(new PointF((float), (float) - (float)), Public static void HighlightResult(PdfGraphics graphics, PdfTextSearchResults result, SolidBrush brush)įor (int i = 0 i < i++)