Skip to content
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.
myCPDFView.StartFindText(keyWord, searchOption);
// Find and select the next match.
myCPDFView.FindNext();
// Find and select the previous match.
myCPDFView.FindPrevious();

Explanation of Search Options

optionsDiscriptionvalue
C_Search_Options.Search_Case_InsensitiveMatch Case Insensitive0
C_Search_Options.Search_Case_SensitiveMatch Case Sensitive1
C_Search_Options.Search_Match_Whole_WordMatch Whole Word2

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
myCPDFView.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
myCPDFView.ReplaceAllText(replaceWord);