Class ImageExtractor

ImageExtractor class

Represents ImageExtractor plugin.

public class ImageExtractor : PdfExtractor

Constructors

NameDescription
ImageExtractor()The default constructor.

Methods

NameDescription
Dispose()Implementation of IDisposable. Actually, it is not necessary for PdfExtractor.
Process(IPluginOptions)Starts PdfExtractor processing with the specified parameters.

Remarks

The ImageExtractor object is used to extract text in PDF documents.

Examples

The example demonstrates how to extract images from PDF document.

// create ImageExtractor object to extract images
using (ImageExtractor extractor = new ImageExtractor())
{
    // create ImageExtractorOptions
    imageExtractorOptions = new ImageExtractorOptions();
    
    // add input file path to data sources
    imageExtractor.AddDataSource(new FileDataSource(inputPath));
    
    // perform extraction process
    ResultContainer resultContainer = extractor.Process(imageExtractorOptions);
    
    // get the image from the ResultContainer object
    var imageExtracted = resultContainer.ResultCollection[0].ToFile();
}

See Also