We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Saving document to a MemoryStream

Thread ID:

Created:

Updated:

Platform:

Replies:

42239 Mar 23,2006 06:08 AM Mar 27,2006 04:16 AM Windows Forms 2
loading
Tags: DocIO
Giorgio Vaccarino
Asked On March 23, 2006 06:08 AM

Hello, I have a problem saving a document to a MemoryStream: when I try to access the stream after the Save method it is closed and thus inaccessible. I think this is a convenient way for a FileStream (the bytes are written and the stream is closed) but what can I do to obtain the contained document as a byte array (to save for example in a database field) ? === IWordDocument doc = new WordDocument(); Stream _str = new MemoryStream(_dataRow.Document); doc.Open(_str, Syncfusion.DocIO.FormatType.Doc); doc.MailMerge.Execute(_dsDom.Domanda); Stream _targetStream = new MemoryStream(); doc.Save(_targetStream, Syncfusion.DocIO.FormatType.Doc); _targetStream.Read(anotherDataRow.Document, ... *Exception*

Administrator [Syncfusion]
Replied On March 24, 2006 08:36 AM

Hi Giorgio, This is a known bug that has already been addressed. I will post the updated assemblies in a couple of hours. Thank you for your patience. Best regards, Stephen. >Hello, >I have a problem saving a document to a MemoryStream: when I try to access the stream after the Save method it is closed and thus inaccessible. I think this is a convenient way for a FileStream (the bytes are written and the stream is closed) but what can I do to obtain the contained document as a byte array (to save for example in a database field) ? > >=== >IWordDocument doc = new WordDocument(); >Stream _str = new MemoryStream(_dataRow.Document); >doc.Open(_str, Syncfusion.DocIO.FormatType.Doc); >doc.MailMerge.Execute(_dsDom.Domanda); >Stream _targetStream = new MemoryStream(); >doc.Save(_targetStream, Syncfusion.DocIO.FormatType.Doc); >_targetStream.Read(anotherDataRow.Document, ... *Exception* > >

Administrator [Syncfusion]
Replied On March 27, 2006 04:16 AM

Hi Giorgio, This defect has been fixed, here are the updated assemblies Syncfusion.DocIO.Base.zip Best regards, Stephen. >Hi Giorgio, > >This is a known bug that has already been addressed. I will post the updated assemblies in a couple of hours. Thank you for your patience. > >Best regards, > >Stephen. > >>Hello, >>I have a problem saving a document to a MemoryStream: when I try to access the stream after the Save method it is closed and thus inaccessible. I think this is a convenient way for a FileStream (the bytes are written and the stream is closed) but what can I do to obtain the contained document as a byte array (to save for example in a database field) ? >> >>=== >>IWordDocument doc = new WordDocument(); >>Stream _str = new MemoryStream(_dataRow.Document); >>doc.Open(_str, Syncfusion.DocIO.FormatType.Doc); >>doc.MailMerge.Execute(_dsDom.Domanda); >>Stream _targetStream = new MemoryStream(); >>doc.Save(_targetStream, Syncfusion.DocIO.FormatType.Doc); >>_targetStream.Read(anotherDataRow.Document, ... *Exception* >> >>

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;