We are trying to load help documents from the server into a RichTextBox. We were going to use HTML files but the image links caused cross domain issues. I saw the post : http://www.telerik.com/community/forums/silverlight/richtextbox/initialize-richtextbox-with-docx-file.aspx so we decided to try switching to docx files. We upgraded to the Nov 2010 release (2010.3.1110.1040) and picked two sample docx files that were created in Word 2007. One has just one small image in it (20kb) and the other is 11 pages (299Kb). The small document loads but larger docs all throw exceptions. Is there only limited support for the docx format?
When we load the larger docx file we get this exception:
System.FormatException occurred
Message=Input string was not in a correct format.
StackTrace:
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Convert.ToSingle(String value, IFormatProvider provider)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlHelper.GetPtProperty(String style, String propertyName)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlHelper.GetSizeFFromString(String style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.ReadImageInlineShape(ImageInline imageInline)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildImageInlineFromShape()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.BuildInline(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.Import(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildDocument()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider.Import(Stream input)
at DataLink.Controls.Help.WebClient_OpenAsyncCompleted(Object sender, OpenReadCompletedEventArgs e)
InnerException:
Imports
Telerik.Windows.Documents.Model
Imports
Telerik.Windows.Documents.FormatProviders.Html
Imports
Telerik.Windows.Documents.FormatProviders.OpenXml
..........
Dim
uri
As
New
Uri(baseUri,
"_help/test.docx"
)
Me
.WebClient.OpenReadAsync(uri)
End
Sub
...............
Private
Sub
WebClient_OpenAsyncCompleted(
ByVal
sender
As
Object
,
ByVal
e
As
OpenReadCompletedEventArgs)
Handles
WebClient.OpenReadCompleted
Dim
formatter
As
New
Docx.DocxFormatProvider
Dim
radDoc
As
RadDocument = formatter.Import(e.Result)
e.Result.Close()
Me
.Editor.Document = radDoc
End
Sub