The table preferred width value set to Auto or in percents is ignored and is always exported with fixed value. Steps to reproduce: Create a table with two columns in RadRichTextBox. Set the table preferred width to auto. Set the table cell preferred width for both columns to 50%. Export to Docx format. Observed result: the table has preferred width as fixed value 6.62 inches. The columns have the correct width. Expected result: the table preferred width to be auto.
NullReferenceException is thrown when the "var" CSS function is used in the HTML on HtmlFormatProvider Import method call.
The exception occurs only for CSS properties processed by RadRichTextBox. For example: "vertical-align", "font-family", "font-weight", "text-decoration-underline", etc.
The following HTML produces such error:
<span style="vertical-align: var(--my-variable);">
</span>
If the span tag doesn't have any content, the error doesn't occur.
The exception stacktrace is:
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.FillSpanProperties(SpanProperties spanProps, EvaluateProperty evalFunction, IEnumerable`1 disregarderdDefaultStyleBagPropertiesCollection)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.CreateSpanFromTextNode(INode childNode, Paragraph paragraph, IEnumerable`1 disregarderdDefaultStyleBagPropertiesCollection)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessContentNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass80_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass80_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass80_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass80_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessHyperlinkNode(INode node, Action innerAction)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessAnnotationsForNode(INode node, Action innerAction)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.<>c__DisplayClass80_0.<ProcessNode>b__0()
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.Windows.Documents.FormatProviders.Html.Import.HtmlDocumentImporter.Import(Stream input)
To work this around, avoid using the "var" function in the CSS.
Working with PasteOptionsPopup may cause an exception in LayoutElement.SetParent. Very difficult to reproduce, having no consistent steps. Maybe it is related to undo of paste command, but there are no other clues aside from this.
bei Telerik.Windows.Documents.Layout.LayoutElement.SetParent(LayoutElement newParent)Numbered lists have invalid values when combining documents by using the InsertFragment method.
Workaround: use RadDocumentMerger:
RadDocument radDocument1 = RtfSourceProvider.Import(rtf1);
RadDocument radDocument2 = RtfSourceProvider.Import(rtf2);
AppendDocumentOptions options = new AppendDocumentOptions();
options.FirstSourceSectionPropertiesResolutionMode = SectionPropertiesResolutionMode.NoSectionBreak;
RadDocumentMerger merger = new RadDocumentMerger(radDocument1);
merger.AppendDocument(radDocument2, options);
RichText.Document = merger.Document;
HtmlFormatProvider: Exception when importing a table that has only width set. In this case, we are trying to measure some elements with float.NaN.
Workaround: Use the HtmlFormatProvider from the Document Processing library.