Class PdfExtractor
Contenuti
[
Nascondere
]Classe PdfExtractor
Rappresenta la funzionalità di base per estrarre testo, immagini e altri tipi di contenuto che possono apparire sulle pagine dei documenti PDF.
public abstract class PdfExtractor : IDisposable, IPlugin
Metodi
Nome | Descrizione |
---|---|
Dispose() | Implementazione di IDisposable. In realtà, non è necessario per PdfExtractor. |
Process(IPluginOptions) | Avvia l’elaborazione di PdfExtractor con i parametri specificati. |
Osservazioni
L’oggetto TextExtractor
è utilizzato per estrarre testo, o ImageExtractor
per estrarre immagini.
Esempi
L’esempio dimostra come estrarre il contenuto testuale di un documento 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();
}
Vedi Anche
- interfaccia IPlugin
- namespace Aspose.Pdf.Plugins
- assembly Aspose.PDF