When I call the following, it works correctly:
- Code: Select all
document.LoadFromFile(@"example.md", FileFormat.Markdown);
But when I try to load the markdown from a stream:
- Code: Select all
public static Document LoadMarkdownDocument(string markdown)
{
var document = new Document();
using (var content = new MemoryStream(Encoding.Default.GetBytes(markdown)))
{
document.LoadFromStream(content, FileFormat.Markdown);
}
return document;
}
This does not work, it gives a "The file format cannot be supported.". Is this suppose to work?
And if not, is there another way to insert markdown into a Spire Document?