Problem With Export Method when Convert To ArrayByte

4 posts, 0 answers
  1. vahid
    vahid avatar
    4 posts
    Member since:
    Sep 2014

    Posted 17 Sep 2014 Link to this post

    I Use of tow method for Import/Exort

    public RadDocument ImportDocx()
    {
    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())
    {
    document = provider.Import(stream);
    }
    }
    return document;
    }

    public void ExportToDocx(RadDocument document)
    {
    DocxFormatProvider provider = new DocxFormatProvider();
    SaveFileDialog saveDialog = new SaveFileDialog();
    saveDialog.DefaultExt = ".docx";
    saveDialog.Filter = "Documents|*.docx";
    bool? dialogResult = saveDialog.ShowDialog();
    if (dialogResult == true)
    {
    using (Stream output = saveDialog.OpenFile())
    {
    provider.Export(document, output);
    MessageBox.Show("Saved Successfuly!");
    }
    }
    }
    buuuuuuuuuut  the size of (output) variable not equal with (document) variable !!!!!!!!!
    please help me








  2. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 22 Sep 2014 Link to this post

    Hello vahid,

     As you already noticed the input and output streams are with different length. This is expected and the reason behind this is that RadRichTextBox may not support all of the features used in the file and won't import the corresponding data.

    I hope this information is helpful for you.

    Regards,
    Mihail
    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. vahid
    vahid avatar
    4 posts
    Member since:
    Sep 2014

    Posted 22 Sep 2014 in reply to Mihail Link to this post

    Hi Mihail

    when Convert Byte to RadDocument,Keep Not Font Color and ....

    please help me
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 24 Sep 2014 Link to this post

    Hi Vahid,

    Rich text formatting such as font color is supported by RadRichTextBox, so I am not sure why you are experiencing this issue. Please provide us with the original document and we will further look into the cause of the behavior.

    Regards,
    Petya
    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