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

IDocumentFormatProvider provider Import is not working for docx file with images

6 Answers 131 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sreevalli
Top achievements
Rank 1
Sreevalli asked on 20 Nov 2013, 09:18 AM
Hi Team,

I'm  trying to import my docx file to Raddocument. its working when docx file is not having any images in it. But,if any images are there its giving Nullable object must have a value exception. Kindly find the below code snip,

 
  private void btnBrowse_Click(object sender, RoutedEventArgs e)
        {
            RadDocument document = new RadDocument();
            IDocumentFormatProvider provider = new DocxFormatProvider();
            OpenFileDialog openDialog = new OpenFileDialog();
            openDialog.Filter = "Documents|*.docx";
            openDialog.Multiselect = false;
            bool? dialogResult = openDialog.ShowDialog();
            if (dialogResult == true)
            {
                using (FileStream stream = openDialog.File.OpenRead())
                {
                    document = provider.Import(stream);
                }
            }
            this.radRichTextBox.Document = document;
        }
 
using dlls of version 2011.3.1116.1040

also i tried with dlls version 2012.3.1129.1050

Help me in this. its very urgent for me:( 

Thanks in advance
  

6 Answers, 1 is accepted

Sort by
0
Accepted
Petya
Telerik team
answered on 22 Nov 2013, 04:15 PM
Hi,

Could you please check the behavior in our online demo which targets the most recent official release of RadControls for Silverlight? Provided that you are experiencing the same issue in the demo, please send us a document which we can use to troubleshoot the issue on our side, as I was unable to replicate it.

I'm looking forward to your reply.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sreevalli
Top achievements
Rank 1
answered on 26 Nov 2013, 10:49 AM

Hi Petya,

I have already seen in Online Demos. but didn't fount any solution to resolve my issue. 

kindly follow Docx File of .docx file which i'm trying to import  



0
Petya
Telerik team
answered on 28 Nov 2013, 02:48 PM
Hello,

Thank you for the provided document.

We investigated the issue and it turns out it is related to an unsupported feature of RadRichTextBox. What you can do in order to show the document in the control for now is to modify the picture on the bottom of the document (the one with the signature), so that it is not aligned with value Inside/ Outside. 

Let us know if you have other comments or questions.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sreevalli
Top achievements
Rank 1
answered on 29 Nov 2013, 05:59 AM
Hi,

Thank you so much. it helped me:)
0
Sreevalli
Top achievements
Rank 1
answered on 29 Nov 2013, 09:33 AM
Hi Petya,

I'm not able to read and replace document data which is in toggle field codes.

Is there any way to read?? kindly find Sample Document.

Thanks in advance
0
Sreevalli
Top achievements
Rank 1
answered on 09 Jan 2014, 11:22 AM
Hi Petya,


when i'm trying to import Docx file (Docx File) its giving me error as "Value was either too large or too small for an Int32".

_document = new RadDocument();
                       byte[] doc = Convert.FromBase64String(MergeCollection[_attachmentCount].Body);
                       IDocumentFormatProvider provider = new DocxFormatProvider();
                       MemoryStream stream = new MemoryStream(doc);
                       _document = provider.Import(stream);

Please kindly help me in this.
Tags
RichTextBox
Asked by
Sreevalli
Top achievements
Rank 1
Answers by
Petya
Telerik team
Sreevalli
Top achievements
Rank 1
Share this question
or