We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document.Save(Stream) issue

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=, Culture=neutral, PublicKeyToken=b77a5c561934e089’. The system cannot find the file specified.


Document html = new Document();

        Page p = html.Pages.Add();
        HtmlFragment h = new HtmlFragment("<b>text</b>");

        using (MemoryStream stream = new MemoryStream())


Thank you for contacting support.

Would you please double check if source of this error is Aspose.PDF for .NET API because we are unable to reproduce it with Aspose.PDF for .NET 19.7. If you still face this problem then please share a narrowed down sample application with us so that we may try to reproduce and investigate further.

This was for pdf .net 19.7.

I just swapped the code to use .netstandard instead and it started working. not sure why though.


Thank you for your kind feedback.

We are glad to know that you are not facing any problem now. Please feel free to contact us if any issue occurs. We will be glad to help you.