• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

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.

Inheritance
object
Text
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public sealed class Text

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
Type Name Description
string searchText
StringComparison comparison
Returns
Type Description
IReadOnlyList<TextMatch>

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
Type Description
IReadOnlyList<TextMatch>

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
Type Name Description
string oldText
string newText
StringComparison comparison
Returns
Type Description
int

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
Type Description
string

ToString()

Gets the full text of the page.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX