Aspose::Pdf::Text::TextFragmentAbsorber class

TextFragmentAbsorber class

Represents an absorber object of text fragments. Performs text search and provides access to search results via TextFragmentAbsorber::TextFragments collection.

class TextFragmentAbsorber : public Aspose::Pdf::Text::TextAbsorber

Methods

MethodDescription
ApplyForAllFragments(System::SharedPtr<Font>)Applies font for all text fragments that were absorbed. It works faster than looping through the fragments if all fragments on the page(s) were absorbed. Otherwise it works similar with looping.
ApplyForAllFragments(float)Applies font size for all text fragments that were absorbed. It works faster than looping through the fragments if all fragments on the page(s) were absorbed. Otherwise it works similar with looping.
ApplyForAllFragments(System::SharedPtr<Font>, float)Applies font and size for all text fragments that were absorbed. It works faster than looping through the fragments if all fragments on the page(s) were absorbed. Otherwise it works similar with looping.
get_Errors() constList of TextExtractionError objects. It contain information about errors were found during text extraction. Searching for errors will performed only if TextSearchOptions.LogTextExtractionErrors = true; And it may decrease performance.
get_ExtractionOptions() overrideGets text extraction options.
get_HasErrors() constValue indicates whether errors were found during text extraction. Searching for errors will performed only if TextSearchOptions.LogTextExtractionErrors = true; And it may decrease performance.
get_Phrase() constGets phrase that the TextFragmentAbsorber searches on the PDF document or page.
get_RegexResults() constGets dictionary of search occurrences that are presented with System.Text.RegularExpressions.Regex class as key and TextFragment as value.
get_Text() overrideGets extracted text that the TextAbsorber extracts on the PDF document or page.
get_TextEditOptions() constGets text edit options. The options define special behavior when requested symbol cannot be written with font.
get_TextFragments()Gets collection of search occurrences that are presented with TextFragment objects.
get_TextReplaceOptions() constGets text replace options. The options define behavior when fragment text is replaced to more short/long.
get_TextSearchOptions() overrideGets search options. The options enable search using regular expressions.
RemoveAllText(System::SharedPtr<Page>)Removes all text from the specified page.
RemoveAllText(System::SharedPtr<Page>, System::SharedPtr<Rectangle>)Removes text inside the specified rectangle from the specified page.
RemoveAllText(System::SharedPtr<Document>)Removes all text from the document.
Reset()Clears TextFragments collection of this TextFragmentAbsorber object.
set_ExtractionOptions(System::SharedPtr<TextExtractionOptions>) overrideSets text extraction options.
set_Phrase(System::String)Sets phrase that the TextFragmentAbsorber searches on the PDF document or page.
set_TextEditOptions(System::SharedPtr<Aspose::Pdf::Text::TextEditOptions>)Sets text edit options. The options define special behavior when requested symbol cannot be written with font.
set_TextFragments(System::SharedPtr<TextFragmentCollection>)Gets collection of search occurrences that are presented with TextFragment objects.
set_TextReplaceOptions(System::SharedPtr<Aspose::Pdf::Text::TextReplaceOptions>)Sets text replace options. The options define behavior when fragment text is replaced to more short/long.
set_TextSearchOptions(System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>) overrideSets search options. The options enable search using regular expressions.
TextFragmentAbsorber()Initializes a new instance of the TextFragmentAbsorber that performs search of all text segments of the document or page.
TextFragmentAbsorber(System::SharedPtr<Aspose::Pdf::Text::TextEditOptions>)Initializes a new instance of the TextFragmentAbsorber with text edit options, that performs search of all text segments of the document or page.
TextFragmentAbsorber(System::String)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase.
TextFragmentAbsorber(System::SharedPtr<System::Text::RegularExpressions::Regex>)Initializes a new instance of the TextFragmentAbsorber class for the specified System.Text.RegularExpressions.Regex class object.
TextFragmentAbsorber(System::String, System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase and text search options.
TextFragmentAbsorber(System::SharedPtr<System::Text::RegularExpressions::Regex>, System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase and text search options.
TextFragmentAbsorber(System::ArrayPtr<System::SharedPtr<System::Text::RegularExpressions::Regex>>, System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase and text search options.
TextFragmentAbsorber(System::String, System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>, System::SharedPtr<Aspose::Pdf::Text::TextEditOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase, text search options and text edit options.
TextFragmentAbsorber(System::String, System::SharedPtr<Aspose::Pdf::Text::TextEditOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase and text edit options.
TextFragmentAbsorber(System::SharedPtr<System::Text::RegularExpressions::Regex>, System::SharedPtr<Aspose::Pdf::Text::TextEditOptions>)Initializes a new instance of the TextFragmentAbsorber class for the specified text phrase and text edit options.
Visit(System::SharedPtr<Page>) overridePerforms search on the specified page.
Visit(System::SharedPtr<Document>) overridePerforms search on the specified document.
Visit(System::SharedPtr<XForm>) overridePerforms search on the specified form object.

Remarks

The TextFragmentAbsorber object is basically used in text search scenario. When the search is completed the occurrences are represented with TextFragment objects that the TextFragmentAbsorber::TextFragments collection contains. The TextFragment object provides access to the search occurrence text, text properties, and allows to edit text and change the text state (font, font size, color etc).

See Also