Class TextExtractor

TextExtractor class

Represents TextExtractor plugin.

public class TextExtractor : PdfExtractor

Constructors

NameDescription
TextExtractor()The default constructor.

Methods

NameDescription
Dispose()Implementation of IDisposable. Actually, it is not necessary for PdfExtractor.
Process(IPluginOptions)Starts PdfExtractor processing with the specified parameters.

Remarks

The TextExtractor object is used to extract text in PDF documents.

Examples

The example demonstrates how to extract text content of PDF document.

// create TextExtractor object to extract text in PDF contents
using (TextExtractor extractor = new TextExtractor())
{
    // create TextExtractorOptions
    textExtractorOptions = new TextExtractorOptions();
    
    // add input file path to data sources
    textExtractorOptions.AddDataSource(new FileDataSource(inputPath));
    
    // perform extraction process
    ResultContainer resultContainer = extractor.Process(textExtractorOptions);
    
    // get the extracted text from the ResultContainer object
    string textExtracted = resultContainer.ResultCollection[0].ToString();
}

See Also