Class PdfExtractor
Pôvodný názov: Aspose.Pdf.Plugins Zhromaždenie: Aspose.PDF.dll (25.4.0)
Predstavuje základnú funkciu na extrahovanie textu, obrázkov a iných typov obsahu, ktoré sa môžu vyskytnúť na stránkach dokumentov PDF.
public abstract class PdfExtractor : IPlugin, IDisposable
Inheritance
Derived
ImageExtractor , TextExtractor
Implements
Z dedičných členov
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Príklad ukazuje, ako extrahovať textový obsah z PDF dokumentu.
// 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
Objekt Aspose.Pdf.Plugins.TextExtractor sa používa na extrahovanie textu, alebo Aspose.Pdf.Plugins.ImageExtractor na extrahovanie obrázkov.
Constructors
PdfExtractor()
protected PdfExtractor()
Methods
Dispose()
Implementácia IDisposable. v skutočnosti to nie je potrebné pre PDFExtractor.
public void Dispose()
Process(IPluginopcie)
Začína sa spracovanie PdfExtractor so špecifikovanými parametrami.
public ResultContainer Process(IPluginOptions pdfExtractorOptions)
Parameters
pdfExtractorOptions
IPluginOptions
Objekt možností, ktorý obsahuje pokyny pre PDFExtractor.
Returns
Objekt ResultContainer obsahujúci výsledok extrakcie.