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

[Solved] IDocumentFormatProvider Dir Not Found

2 Answers 219 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marcel
Top achievements
Rank 1
Marcel asked on 04 Sep 2011, 06:10 PM
Hi, So I have a function in which i try and create a raddocument using the IDocumentFormatProvider.Import. 

 RadDocument document = null;
   IDocumentFormatProvider provider = new DocxFormatProvider();

   try
   {
    document = provider.Import(inputBytes);
   }
   catch (Exception ex)
   {
    string ecp = ex.Message;
    MessageBox.Show(ex.Message);
   }

inputBytes contains the bytes from a docx file, but when i run the function i get the exception "Dir not found".

Any help on this would be great.

Thanks.

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Marcel
Top achievements
Rank 1
answered on 04 Sep 2011, 06:53 PM
Forgot this part also: 

{System.Exception: Dir not found! at Telerik.Windows.Zip.ZipPackage.Locate(Stream fileStream)}
0
Accepted
Iva Toteva
Telerik team
answered on 07 Sep 2011, 01:55 PM
Hi Marcellino,

There are two possible reasons why the format provider fails to create a document from the bytes.
The first one is that during the conversion of the document to byte array, the document has been corrupted. For example, using the GetBuffer method of streams instead of ToArray can cause similar issues. More information on that can be found on MSDN.
Another possible reason is that there is a bug with the import of the document you are using. You can verify that by trying opening the original file in our online demo. If you manage to reproduce the issue, you can send us the file for review. If it conforms to the OpenXml specification, we will do our best to fix the import.

Kind regards,
Iva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
RichTextBox
Asked by
Marcel
Top achievements
Rank 1
Answers by
Marcel
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or