Class TextExtractor

TextExtractor-Klasse

Stellt das TextExtractor-Plugin dar.

public class TextExtractor : PdfExtractor

Konstruktoren

NameBeschreibung
TextExtractor()Der Standardkonstruktor.

Methoden

NameBeschreibung
Dispose()Implementierung von IDisposable. Tatsächlich ist es für PdfExtractor nicht notwendig.
Process(IPluginOptions)Startet die PdfExtractor-Verarbeitung mit den angegebenen Parametern.

Bemerkungen

Das TextExtractor-Objekt wird verwendet, um Text in PDF-Dokumenten zu extrahieren.

Beispiele

Das Beispiel zeigt, wie man den Textinhalt eines PDF-Dokuments extrahiert.

// 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();
}

Siehe auch