Loading specific file formats

In some cases it’s required to specify the document format manually to guarantee correct output produced by GroupDocs.Parser. The following are the cases when the document format must be specified manually:

  • Markdown documents
  • MHTML documents
  • OTP documents (OpenDocument Presentation Template)
  • Databases
  • Emails from remote servers

Here are the steps to specify the document format for Markup document.

The following example shows how to specify the document format for Markup document:

// Create an instance of Parser class for markdown document
using (Parser parser = new Parser(stream, new LoadOptions(FileFormat.Markup)))
{
    // Check if text extraction is supported
    if (!parser.Features.Text)
    {
        Console.WriteLine("Text extraction isn't supported.");
        return;
    }
    using (TextReader reader = parser.GetText())
    {
        // Print the document text
        // Markdown is detected; text without special symbols is printed
        Console.WriteLine(reader.ReadToEnd());
    }
}

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document parser App

Along with full featured .NET library we provide simple, but powerful free Apps.

You are welcome to parse documents and extract data from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.

© Aspose Pty Ltd 2001-2022. All Rights Reserved.