TextAbsorber Class
Represents an absorber object of a text. Performs text extraction and provides access to the result via Text object.
Inheritance Hierarchy

Namespace: Aspose.Pdf.Text
Assembly: Aspose.PDF (in Aspose.PDF.dll) Version: 20.6
Syntax
public class TextAbsorber

The TextAbsorber type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleTextAbsorber
Initializes a new instance of the TextAbsorber.
Public methodCode exampleTextAbsorber(TextExtractionOptions)
Initializes a new instance of the TextAbsorber with extraction options.
Public methodTextAbsorber(TextSearchOptions)
Initializes a new instance of the TextAbsorber with text search options.
Public methodTextAbsorber(TextExtractionOptions, TextSearchOptions)
Initializes a new instance of the TextAbsorber with extraction and text search options.
Properties
  NameDescription
Public propertyErrors
List 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.
Public propertyCode exampleExtractionOptions
Gets or sets text extraction options.
Public propertyHasErrors
Value indicates whether errors were found during text extraction. Searching for errors will performed only if TextSearchOptions.LogTextExtractionErrors = true; And it may decrease performance.
Public propertyCode exampleText
Gets extracted text that the TextAbsorber extracts on the PDF document or page.
Public propertyTextSearchOptions
Gets or sets text search options.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Public methodCode exampleVisit(Document)
Extracts text on the specified document
Public methodCode exampleVisit(Page)
Extracts text on the specified page
Public methodCode exampleVisit(XForm)
Extracts text on the specified XForm.
Remarks
The TextAbsorber object is used to extract text from a Pdf document or the document's page.
Examples
The example demonstrates how to extract text on the first PDF document page.
C#
// open document
Document doc = new Document(inFile);

// create TextAbsorber object to extract text
TextAbsorber absorber = new TextAbsorber();

// accept the absorber for first page
doc.Pages[1].Accept(absorber);

// get the extracted text
string extractedText = absorber.Text;
See Also