problem importing large docx memorystreams into RadRichTextBox

4 posts, 0 answers
  1. Michael
    Michael avatar
    7 posts
    Member since:
    Sep 2012

    Posted 16 Jun 2014 Link to this post

    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
  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 19 Jun 2014 Link to this post

    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.
     
  3. DevCraft banner
  4. Michael
    Michael avatar
    7 posts
    Member since:
    Sep 2012

    Posted 22 Jun 2014 in reply to Kammen Link to this post

    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.
  5. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 24 Jun 2014 Link to this post

    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.
     
Back to Top