When trying to save a Document file as a stream, I’m getting this error:
Could not load file or assembly ‘System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. The system cannot find the file specified.
Code:
Document html = new Document();
Page p = html.Pages.Add();
HtmlFragment h = new HtmlFragment("<b>text</b>");
p.Paragraphs.Add(h);
using (MemoryStream stream = new MemoryStream())
{
html.Save(stream);
}