Hi, I've got the Q3.2010 RadControls and I've implemented an editor using the RichTextBox.
What I need to be able to do is open a .docx file, and then use the RichTextBox's built in functionality to export to Html.
This works perfectly with the reference document I was originally testing with.
However, it turns out that the editor breaks with almost every other document I try.
It seems to have something to do with images and/or certain formatting.
The documents in question open just fine in the editor, and are displayed correctly.
When I try to export to HTML it breaks.
Below is the code I am using to export:
This code throws out an error for most documents. The error varies slightly, but below is an example of the error:
For another document I tried, I get the below error stack:
Please advise as to what I could try to get this working? I need to deliver this solution ASAP.
Thanks.
What I need to be able to do is open a .docx file, and then use the RichTextBox's built in functionality to export to Html.
This works perfectly with the reference document I was originally testing with.
However, it turns out that the editor breaks with almost every other document I try.
It seems to have something to do with images and/or certain formatting.
The documents in question open just fine in the editor, and are displayed correctly.
When I try to export to HTML it breaks.
Below is the code I am using to export:
HtmlFormatProvider provider =
new
HtmlFormatProvider();
return
provider.Export(document);
This code throws out an error for most documents. The error varies slightly, but below is an example of the error:
Uncaught Error: Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportImage_UriSource(ImageInline imageInline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportImageInline(ImageInline imageInline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportInline(Inline inline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportParagraphContents(Paragraph paragraph)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBlockContainer(IBlockContainer blockContainer)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBodyContent()
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBody()
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportDocumentInternal(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.Export(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document)
at ArticleEditor.MainPage.ExportToString(RadDocument document)
at ArticleEditor.MainPage.Save_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
For another document I tried, I get the below error stack:
Uncaught Error: Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportImage_UriSource(ImageInline imageInline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportImageInline(ImageInline imageInline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportInline(Inline inline)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportParagraphContents(Paragraph paragraph)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBlockContainer(IBlockContainer blockContainer)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportTable(Table table)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBlockContainer(IBlockContainer blockContainer)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportTable(Table table)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBlockContainer(IBlockContainer blockContainer)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportTable(Table table)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBlockContainer(IBlockContainer blockContainer)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBodyContent()
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportBody()
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.ExportDocumentInternal(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.Export.HtmlDocumentExporter.Export(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document, Stream output)
at Telerik.Windows.Documents.FormatProviders.Html.HtmlFormatProvider.Export(RadDocument document)
at ArticleEditor.MainPage.ExportToString(RadDocument document)
at ArticleEditor.MainPage.Save_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Please advise as to what I could try to get this working? I need to deliver this solution ASAP.
Thanks.