We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Question About PDF Viewer and Text Search

I am building a PDF viewer application using your PDFViewerControl, using my own user interface instead of the one that's built in to the control.

At present I'm trying to figure out how to implement a text search with more features than the included search toolbar. My issues are:

  • I need to include "Match Case" and "Whole Word Only" functionality
  • Regular Expression capability would be great but can do without it
  • I need "Find All" capability

As to Find All, I would have thought the ability to use the dictionary which contains the rectangle coordinates of the words (FindText) would be something I could use by filling each rectangle with a semitransparent color. But I have not been able to get this to work. No exceptions are raised but there is no visible effect in the document. The code below jumps to the appropriate page and then "should" fill the rectangles:

Private Sub btn_LookDown_Click(sender As Object, e As EventArgs) Handles btn_LookDown.Click
Try
srchCount += 1
pdf.GoToPageAtIndex(textSearch.Keys(srchCount) + 1)

Dim g As Graphics = pdf.CreateGraphics
Dim br As New SolidBrush(Color.FromArgb(128, 255, 0, 0))
g.FillRectangles(br, textSearch(srchCount).ToArray)

Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub

Is there a way to achieve the functionality I want via the PDF namespace? I do not fully understand OCR yet (haven't had time to dig too deeply) but thought I might find an answer there. Any suggestions are appreciated.

One other item: Setting the BackColor property of the PDFViewerControl has no effect. I'd like to be able to change it so the area around the document matches the color scheme of the application.

Thanks

- - AB



1 Reply

US Uthistran S Syncfusion Team September 4, 2015 09:00 AM UTC

Hi Alan,
We have created three support incidents for better follow up under your account. Please log on to our support website to check for further updates,
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Regards,
Uthistran S.

Loader.
Live Chat Icon For mobile
Up arrow icon