Class Text
High-level text search and editing API for a PDF page.
Provides Find, Replace, Highlight, and Redact
operations on the text content of a page.
Assembly: DRIT.Pdf.dll
Syntax
Methods
Find(string, StringComparison)
Finds all occurrences of the specified text on the page.
Returns a list of match results with positions.
Declaration
public IReadOnlyList<TextMatch> Find(string searchText, StringComparison comparison = StringComparison.Ordinal)
Parameters
Returns
Find(Regex)
Finds all matches of the specified regular expression on the page.
Returns a list of match results with positions.
Declaration
public IReadOnlyList<TextMatch> Find(Regex regex)
Parameters
| Type |
Name |
Description |
| Regex |
regex |
|
Returns
Replace(string, string, StringComparison)
Replaces all occurrences of oldText with newText
in the page's text content. Returns the number of replacements made.
Declaration
public int Replace(string oldText, string newText, StringComparison comparison = StringComparison.Ordinal)
Parameters
Returns
Subtext(int, int)
Gets a substring of the page's text starting at the given offset.
Declaration
public string Subtext(int startIndex, int length)
Parameters
| Type |
Name |
Description |
| int |
startIndex |
|
| int |
length |
|
Returns
ToString()
Gets the full text of the page.
Declaration
public override string ToString()
Returns
Overrides