There seems to be a problem importing large docx memorystreams into RadRichTextBox.
My repo is as follows:
I read a docx file into a memorystream MS.
I then call the code below. I get a "ObjectDisposedException" error during import. The stream length is 7642481 bytes, but only 7391515 bytes got read.
If i comment out the memory stream import and replace with a file open/ IO stream import (which is what you would have used in the RadRichTextbox) then it works ok.
To test you can download the docx file from the link below.
My guess the problem is related to the length of the memory stream.
private void RadRibbonButton_save_Click_1(object sender, RoutedEventArgs e)
{
{
// RadDocument document = null;
IDocumentFormatProvider provider = new DocxFormatProvider();
OpenFileDialog openDialog = new OpenFileDialog();
openDialog.Filter = "Documents|*.docx";
openDialog.Multiselect = false;
bool? dialogResult = openDialog.ShowDialog();
if (dialogResult == true)
{
using (Stream stream = openDialog.File.OpenRead())
{
this.radRichTextBox.Document = provider.Import(MS); //note* MS got read from a WCF server,
// this.radRichTextBox.Document = provider.Import(stream);
}
}
}
https://ezzydoc.blob.core.windows.net/docs/27765.docx?sv=2012-02-12&st=2014-06-16T04%3A37%3A05Z&se=2114-06-16T04%3A42%3A05Z&sr=b&sp=r&sig=mLa%2FZL82r%2FJQpBLhgEOFQr6XrznBDvdMEAqNQLdfPRQ%3D
My repo is as follows:
I read a docx file into a memorystream MS.
I then call the code below. I get a "ObjectDisposedException" error during import. The stream length is 7642481 bytes, but only 7391515 bytes got read.
If i comment out the memory stream import and replace with a file open/ IO stream import (which is what you would have used in the RadRichTextbox) then it works ok.
To test you can download the docx file from the link below.
My guess the problem is related to the length of the memory stream.
private void RadRibbonButton_save_Click_1(object sender, RoutedEventArgs e)
{
{
// RadDocument document = null;
IDocumentFormatProvider provider = new DocxFormatProvider();
OpenFileDialog openDialog = new OpenFileDialog();
openDialog.Filter = "Documents|*.docx";
openDialog.Multiselect = false;
bool? dialogResult = openDialog.ShowDialog();
if (dialogResult == true)
{
using (Stream stream = openDialog.File.OpenRead())
{
this.radRichTextBox.Document = provider.Import(MS); //note* MS got read from a WCF server,
// this.radRichTextBox.Document = provider.Import(stream);
}
}
}
https://ezzydoc.blob.core.windows.net/docs/27765.docx?sv=2012-02-12&st=2014-06-16T04%3A37%3A05Z&se=2114-06-16T04%3A42%3A05Z&sr=b&sp=r&sig=mLa%2FZL82r%2FJQpBLhgEOFQr6XrznBDvdMEAqNQLdfPRQ%3D