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

Is there a way to cycle threw search results?

     If a search returns multiple hits for the search text there doesn't seem to be a way to cycle through the results. The user can page up and down and see the highlighted text but there is no way to bounce from first instance -> second instance -> third instance and so on. Is there a way to do this?

Also is there a way to change the highlight colour? The beige yellowish colour doesn't stand out at all on smaller screens.

Thanks

Ed Barnes

1 Reply

BS Balasubramanian Sundararajan Syncfusion Team May 19, 2017 12:38 PM UTC

Hi Ed Barnes, 
 
Please find the details of your query from below, 
 
Query 
Details 
 If a search returns multiple hits for the search text there doesn't seem to be a way to cycle through the results. The user can page up and down and see the highlighted text but there is no way to bounce from first instance -> second instance -> third instance and so on. Is there a way to do this? 
We have provided support for searching the next immediate occurrence of the searched text and the previous occurrence of the searched text using SearchNext and SearchPrevious methods respectively. Please find the list of APIs and methods provided in our PDF viewer control for customization. 
 
SearchText -  Highlights all the occurrences of the searched text. 
 
SearchNext – Highlights the next immediate occurrence of the searched text. 
 
SearchPrevious  - Highlights the previous occurrence of the searched text. 
 
CancelSearch – Cancels the text search operation. 
 
We have created a simple sample which illustrates searching the next and previous occurrences of the text and the sample can be downloaded from the following link, 
 
 
 
Also is there a way to change the highlight colour? The beige yellowish colour doesn't stand out at all on smaller screens. 
We can customize the current instance and the other highlighted instance color in our PDF viewer control and it can be achieved using the `TextSearchSettings` API which is available in our SfPdfViewer control. 
 
Usage: 
 
pdfViewerControl.TextSearchSettings.CurrentInstanceColor = UIColor.FromRGBA(0, 0, 255, 120); 
                                                pdfViewerControl.TextSearchSettings.OtherInstanceColor = UIColor.FromRGBA(0, 0, 255, 50); 
 
Please try the above sample and let us know if you have any further assistance. 
 
Thanks, 
Balasubramanian S 
 


Loader.
Up arrow icon