GroupDocs.Parser for .NET 25.1 Release Notes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
PARSERNET-2587ArgumentException when parsing POTX fileBug
PARSERNET-2588Raises ArgumentOutOfRangeException when opening item parserBug
PARSERNET-2594Specify file type when opening document (stream or file)Improvement

Public API and Backward Incompatible Changes

Specify file type when opening document (stream or file)

Description

The file type is determined by the file extension (if present; fast) or the file content (for the stream or if the file extension is not present or not recognized; slow, since the file content is recognized by algorithms). This feature allows you to specify a file type using LoadOptions to avoid the detection procedure.

Public API changes

LoadOptions public class was updated with changes as follows:

Usage

The following example shows how to specify the file type:

// Create an instance of Parser class for markdown document
using (Parser parser = new Parser(stream, new LoadOptions(FileType.MD)))
{
    // 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());
    }
}