Class PdfExtractor
Contents
[
Hide
]PdfExtractor class
Represents base functionality to extract text, images, and other types of content that may occur on the pages of PDF documents.
public abstract class PdfExtractor : IDisposable, IPlugin
Methods
Name | Description |
---|---|
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, or ImageExtractor
to extract images.
Examples
The example demonstrates how to extract text content of PDF document.
// 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();
}
See Also
- interface IPlugin
- namespace Aspose.Pdf.Plugins
- assembly Aspose.PDF