This is a migrated thread and some comments may be shown as answers.

problem importing large docx memorystreams into RadRichTextBox

3 Answers 26 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 17 Jun 2014, 01:33 AM
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

3 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 19 Jun 2014, 02:53 PM
Hello Michael,

Thank you for the interest in RadRichTextBox.

We were able to reproduce this. We will add it to our backlog but we cannot give you any time frame when this will be fixed.

The Telerik points are updated in your account in appreciation of your involvement.

Regards,
Kammen
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Michael
Top achievements
Rank 1
answered on 23 Jun 2014, 12:41 AM
Can you confirm that the problem is related to the document length not some other problem, and if so what length.

If that is the case then i can place a limit on large documents to avoid the problem.

thanks.
0
Kammen
Telerik team
answered on 24 Jun 2014, 08:31 AM
Hello Michael,

The problem is not in the length. In order to workaround this you should use streams that support only Read operation. 

The fix is released with the LIB this week so you can test if the problem still exists.

Hope this answers your questions.

Regards,
Kammen
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Michael
Top achievements
Rank 1
Share this question
or