Extractor Class
Provides the functionality for fast extracting text and metadata from documents.
Inheritance Hierarchy
SystemObject
  GroupDocs.ParserExtractor

Namespace: GroupDocs.Parser
Assembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 19.5
Syntax
public class Extractor

The Extractor type exposes the following members.

Constructors
  NameDescription
Public methodExtractor
Initializes a new instance of the Extractor class.
Public methodExtractor(MediaTypeDetector, EncodingDetector, INotificationReceiver)
Initializes a new instance of the Extractor class.
Public methodExtractor(MediaTypeDetector, EncodingDetector, INotificationReceiver, DocumentFormatter)
Initializes a new instance of the Extractor class.
Properties
  NameDescription
Public propertyEncodingDetector
Gets an encoding detector.
Public propertyMediaTypeDetector
Gets a media type detector.
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExtractFormattedText(Stream)
Extracts a formatted text.
Public methodExtractFormattedText(String)
Extracts a formatted text.
Public methodExtractFormattedText(Stream, LoadOptions)
Extracts a formatted text.
Public methodExtractFormattedText(String, LoadOptions)
Extracts a formatted text.
Public methodExtractMetadata(Stream)
Extracts the metadata.
Public methodExtractMetadata(String)
Extracts the metadata.
Public methodExtractMetadata(Stream, LoadOptions)
Extracts the metadata.
Public methodExtractMetadata(String, LoadOptions)
Extracts the metadata.
Public methodExtractText(Stream)
Extracts a text.
Public methodExtractText(String)
Extracts a text.
Public methodExtractText(Stream, LoadOptions)
Extracts a text.
Public methodExtractText(String, LoadOptions)
Extracts a text.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodSendNotificationMessage
Sends notification message to receiver and factory receiver (if presented).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Fields
  NameDescription
Public fieldStatic memberDefault
A default extractor.
Examples

Extracting metadata:

C#
// Create an extractor
Extractor extractor = new Extractor();
// Extract a metadata
MetadataCollection metadata = extractor.ExtractMetadata(fileName);

// If a file format isn't supported
if (metadata == null)
{
  // Print a message
  Console.WriteLine("The document format is not supported");
}

Extracting a text:

// Extract a text from the stream
Console.WriteLine(Extractor.Default.ExtractText(stream));
// Extract a text from the file
Console.WriteLine(Extractor.Default.ExtractText(fileName));

Extracting a formatted text:

// Extract a formatted text from the stream
Console.WriteLine(Extractor.Default.ExtractFormattedText(stream));
// Extract a formatted text from the file
Console.WriteLine(Extractor.Default.ExtractFormattedText(fileName));
See Also