Class PdfExtractor

Class PdfExtractor

Nom dels espais: Aspose.Pdf.Plugins Assemblea: Aspose.PDF.dll (25.4.0)

Representa la funcionalitat de base per extreure text, imatges i altres tipus de contingut que puguin ocórrer a les pàgines de documents PDF.

public abstract class PdfExtractor : IPlugin, IDisposable

Inheritance

object PdfExtractor

Derived

ImageExtractor , TextExtractor

Implements

IPlugin , IDisposable

Membres heretats

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

L’exemple demostra com extreure contingut de text del document PDF.

// create TextExtractor object to extract PDF contents
using (TextExtractor extractor = new TextExtractor())
{
    // create TextExtractorOptions object to set instructions
    textExtractorOptions = new TextExtractorOptions();

    // add input file path to data sources
    textExtractorOptions.AddInput(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();
}

Remarks

L’objecte Aspose.Pdf.Plugins.TextExtractor s’utilitza per extreure text, o Aspose.Pdf.Plugins.ImageExtractor per extreure imatges.

Constructors

PdfExtractor()

protected PdfExtractor()

Methods

Dispose()

Implementació de IDisposable. De fet, no és necessari per a PdfExtractor.

public void Dispose()

Process(Opcions IPlugin)

Comença el tractament de PdfExtractor amb els paràmetres especificats.

public ResultContainer Process(IPluginOptions pdfExtractorOptions)

Parameters

pdfExtractorOptions IPluginOptions

Un objecte d’opcions que conté instruccions per al PdfExtractor.

Returns

ResultContainer

Un objecte de ResultContainer que conté el resultat de l’extracci.

 Català