GroupDocs.Parser for .NET 25.1 Release Notes
This page contains release notes for GroupDocs.Parser for .NET 25.1
Full List of Issues Covering all Changes in this Release
Key | Summary | Category |
---|---|---|
PARSERNET-2587 | ArgumentException when parsing POTX file | Bug |
PARSERNET-2588 | Raises ArgumentOutOfRangeException when opening item parser | Bug |
PARSERNET-2594 | Specify 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:
Added LoadOptions(FileType) constructor.
Added LoadOptions(FileType, string) constructor.
Added LoadOptions(FileTypet, string, Encoding, Encoding) constructor.
Added LoadOptions(FileType, string, Encoding, Encoding, TimeSpan) constructor.
Added FileType property.
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());
}
}