There are two parts to text searching. First is the UI component that is presented to the user. Second is an API guide to perform the text search functionality.
Text search functionality can be added to your viewer using the text search UI component. Alternatively, you can programmatically perform text search in PDFViewCtrl.
Apryse provides SearchToolbar
and FindTextOverlay
as utility classes for implementing text search in your document viewer. Here is a short guide on adding text search to your activity:
onCreate
of your activity, set up your SearchToolbar
and FindTextOverlay
:Now when running the app, you will see a toolbar that allows you to enter search terms as well as an overlay on top of the PDFViewCtrl that navigates among search results.
SearchResultsView
class enables users to easily search for a query and see the results.
To set up your layout for a SearchResultsView
, add an element to your XML layout as follows:
Then, you need to set the following events
To search for text in a PDF using regular expression and then apply a link annotation on the highlighted result.
In this example, we add a link annotation but any other types of annotations can be applied here such as redaction annotations in the case of a search and redact workflow.
Search PDF files for text
Full code sample which shows how to use TextSearch to search text on PDF pages using regular expressions.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales