First I read/import a .docx in your richtextbox. I then save/export this file as .xaml format. When I try to read/import this file back I get this exception:
System.Windows.Markup.XamlParseException occurred |
LineNumber=3 |
LinePosition=31 |
Message=Failed to create a 'System.Double' from the text '13,3333330154419'. [Line: 3 Position: 31] |
StackTrace: |
ved MS.Internal.XcpImports.CreateFromXaml(String xamlString, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers, Boolean expandTemplatesDuringParse) |
ved MS.Internal.XcpImports.CreateFromXaml(String xamlString, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers) |
ved System.Windows.Markup.XamlReader.Load(String xaml) |
ved Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Import(Stream input) |
ved I2.document_editor.ButtonOpen_Click(Object sender, RoutedEventArgs e) |
InnerException: System.Collections.Generic.KeyNotFoundException |
Message=The given key was not present in the dictionary. |
StackTrace: |
ved System.ThrowHelper.ThrowKeyNotFoundException() |
ved System.Collections.Generic.Dictionary`2.get_Item(TKey key) |
ved System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType) |
InnerException: |
This is line 3:
<t:Paragraph SpacingAfter="13,3333330154419" FontSize="16">
Another issue that I found is when I try follow your online documentation:
Public Function ExportToXAML(document As RadDocument) As String |
Dim provider As IDocumentFormatProvider = New XamlFormatProvider() |
Dim exportValue As String = [String].Empty |
Using output As New MemoryStream() |
provider.Export(document, output) |
output.Seek(0, SeekOrigin.Begin) |
Using reader As New StreamReader(output) |
exportValue = reader.ReadToEnd() |
End Using |
End Using |
Return exportValue |
End Function |
If I want to export to .docx instead of .xaml the only thing I need to do is to swap the xamlformaprovider with the docxformatprovider, but that throws an exception:
System.ObjectDisposedException was unhandled by user code |
Message=Cannot access a closed Stream. |
ObjectName="" |
StackTrace: |
ved System.IO.__Error.StreamIsClosed() |
ved System.IO.MemoryStream.Seek(Int64 offset, SeekOrigin loc) |
ved I2.document_editor.ExportDocToDOCX() |
ved I2.document_editor.SaveFile(String _parameter) |
ved I2.document_editor.SetFileName(String _text) |
ved I2.text_input_window.ButtonOK_Click(Object sender, RoutedEventArgs e) |
ved System.Windows.Controls.Primitives.ButtonBase.OnClick() |
ved System.Windows.Controls.Button.OnClick() |
ved Telerik.Windows.Controls.RadButton.OnClick() |
ved System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) |
ved System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) |
ved MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) |
InnerException: |