On this page
Guides
Find and Replace
In content editing mode, users can perform text search and replace within PDF documents.
Text Search
After entering the keywords that need to be replaced and configuring the search parameters, you can navigate throughout the entire document by using forward and backward search, selecting and highlighting the matching items.
This example shows how to entering keywords and search settings, as well as selecting the next and previous matches:
C#
// Enter the keywords to be replaced along with the search settings.
tool.StartFindText(keyWord, searchOption);
// Find and select the next match.
tool.FindNext();
// Find and select the previous match.
tool.FindPrevious();
Explanation of Search Options
options | Discription | value |
---|---|---|
C_Search_Options.Search_Case_Insensitive | Match Case Insensitive | 0 |
C_Search_Options.Search_Case_Sensitive | Match Case Sensitive | 1 |
C_Search_Options.Search_Match_Whole_Word | Match Whole Word | 2 |
Replace Single
Users can choose to replace the currently selected match.
This example shows how to replacing the currently selected match:
C#
// Replace the currently selected match
tool.ReplaceText(replaceWord);
Replace All
Users can choose to replace all matching items.
This example shows how to replacing all matching items throughout the document:
C#
// Replace all matching items
tool.ReplaceAllText(replaceWord);