TextFragmentAbsorber

TextFragmentAbsorber

Overview

TextFragmentAbsorber is a class in Aspose.PDF FOSS for .NET.

Searches for text fragments on PDF pages, optionally matching a search phrase.

This class provides 21 methods for working with TextFragmentAbsorber objects in .NET programs. Available methods include: ApplyForAllFragments, RemoveAllText, Reset, TextFragmentAbsorber, Visit. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Errors, ExtractionOptions, HasErrors, Phrase, RegexResults, Text, and 4 more.

Properties

NameTypeAccessDescription
TextEditOptionsTextEditOptionsRead/WriteEdit options applied during text replacement / font substitution.
TextFragmentsTextFragmentCollectionRead/WriteFound text fragments.
ErrorsList<TextExtractionError>ReadDiagnostics emitted while extracting text.
HasErrorsboolReadTrue when Errors has at least one entry.
RegexResultsDictionary<System.Text.RegularExpressions.Regex, TextFragmentCollection>ReadPer-regex fragment groups when constructed via the Regex[] ctor; empty otherwise.
Phrasestring?Read/WriteGets or sets the search phrase.
TextstringReadGets the concatenated text of all found fragments.
ExtractionOptionsTextExtractionOptionsRead/WriteGets or sets the text extraction options.
TextSearchOptionsTextSearchOptionsRead/WriteGets or sets the text search options.
TextReplaceOptionsTextReplaceOptionsRead/WriteGets or sets text replace options for controlling replacement behavior.

Methods

SignatureDescription
TextFragmentAbsorber()Create an absorber that collects all text fragments.
TextFragmentAbsorber(searchPhrase: string, isRegex: bool)Create an absorber that searches for a specific phrase.
TextFragmentAbsorber(phrase: string)Create an absorber for a single literal phrase.
TextFragmentAbsorber(phrase: string, textEditOptions: TextEditOptions)Create an absorber for a phrase with edit options.
TextFragmentAbsorber(phrase: string, textSearchOptions: TextSearchOptions)Create an absorber that searches for a specific phrase with search options.
TextFragmentAbsorber(phrase: string, textSearchOptions: TextSearchOptions, textEditOptions: TextEditOptions)Create an absorber for a phrase with search + edit options.
TextFragmentAbsorber(regex: System.Text.RegularExpressions.Regex, textEditOptions: TextEditOptions)Create an absorber from a regex with edit options.
TextFragmentAbsorber(regex: System.Text.RegularExpressions.Regex, textSearchOptions: TextSearchOptions)Create an absorber from a regex with search options.
TextFragmentAbsorber(regexes: System.Text.RegularExpressions.Regex[], textSearchOptions: TextSearchOptions)Create an absorber from an array of regexes; each compiles into its own RegexResults entry.
TextFragmentAbsorber(regex: System.Text.RegularExpressions.Regex)Create an absorber that searches using a precompiled .NET Regex.
TextFragmentAbsorber(textEditOptions: TextEditOptions)Create an absorber configured with the given edit options.
Visit(page: Page)Visit a page and extract/search text fragments.
Visit(xForm: XForm)Search the content stream of a Form XObject for text fragments.
Visit(pdf: Document)Visit all pages of a document.
ApplyForAllFragments(font: Font)Apply the supplied font to every absorbed fragment.
ApplyForAllFragments(font: Font, fontSize: float)Apply the supplied font + size to every absorbed fragment.
ApplyForAllFragments(fontSize: float)Apply the supplied font size to every absorbed fragment.
RemoveAllText(document: Aspose.Pdf.Document)Replace every fragment’s text with the empty string across every page in the document.
RemoveAllText(page: Aspose.Pdf.Page)Replace every fragment’s text with the empty string on the given page.
RemoveAllText(page: Aspose.Pdf.Page, rect: Aspose.Pdf.Rectangle)Replace every fragment’s text with the empty string on the given page, restricted to rect.
Reset()Clear absorbed fragments, errors, and per-regex results.

See Also