This question is locked. New answers and comments are not allowed.
I get the following error when tying to import some docx files containing images
System.Collections.Generic.KeyNotFoundException was unhandled by user code
Message=The given key was not present in the dictionary.
StackTrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.PartRelationsImporter.GetRelationByID(String relationID)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.InitIImageDocumentElementFromRelationID(IImageDocumentElement image, String imageRelationID)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.SetImageInlineProperties(String imageRelationID, IImageDocumentElement imageInline)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.ReadFloatingImageBlockFromDrawing()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.ReadImageFromDrawing()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildInline(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildRun(Style style, Paragraph paragraph)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.Import(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildDocumentFromBlocks(String endElementName)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.HeaderFooterImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentAndRelationsFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadHeadersFooters()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider.Import(Stream input)
at RtfEditor.MainPage.<>c__DisplayClass1.<ImportDocumentFromUrl>b__0(Object s, OpenReadCompletedEventArgs args)
at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
at System.Net.WebClient.OpenReadOperationCompleted(Object arg)
InnerException:
The documents are generated server side based on Word templates. They open correctly in Word.
You can download a sample file from http://pivotaltest.catalystrisk.co.nz/Downloads/AfterSpire.docx
Any ideas?
System.Collections.Generic.KeyNotFoundException was unhandled by user code
Message=The given key was not present in the dictionary.
StackTrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.PartRelationsImporter.GetRelationByID(String relationID)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.InitIImageDocumentElementFromRelationID(IImageDocumentElement image, String imageRelationID)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.SetImageInlineProperties(String imageRelationID, IImageDocumentElement imageInline)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.ReadFloatingImageBlockFromDrawing()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.ReadImageFromDrawing()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildInline(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildRun(Style style, Paragraph paragraph)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.Import(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildDocumentFromBlocks(String endElementName)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.HeaderFooterImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentAndRelationsFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadHeadersFooters()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider.Import(Stream input)
at RtfEditor.MainPage.<>c__DisplayClass1.<ImportDocumentFromUrl>b__0(Object s, OpenReadCompletedEventArgs args)
at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
at System.Net.WebClient.OpenReadOperationCompleted(Object arg)
InnerException:
The documents are generated server side based on Word templates. They open correctly in Word.
You can download a sample file from http://pivotaltest.catalystrisk.co.nz/Downloads/AfterSpire.docx
Any ideas?