HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › .NET Generating PDF into MemoryStream instead of the file › Re: Re: .NET Generating PDF into MemoryStream instead of the file
May 13, 2011 at 08:09
#28207
This is a common problem with MemoryStream usage in code ported from java.
Try this workaround (it works fine for me):
http://connect.microsoft.com/VisualStudio/feedback/details/164680/streamwriter-incorrectly-disposes-underlying-stream
Basically decorate the underlying memory stream (the argument to StreamWriter) as:
streamWriter(new NonDisposingStreamDecorator(memoryStream))
Alex