First Scenario: During layout of specific documents where the first section is with Continuous section break type, the layout algorithm enters in an infinite loop causing the application to hang.
document.Sections.First.PreviousSectionBreakType = SectionBreakType.NextPage;
Size pagesize = radDocument.Sections.Last.PageSize;
radDocument.Sections.Last.PageSize = new Size(pagesize.Width - 0.001, pagesize.Height - 0.001);
Implement support for the SET field.
Using Microsoft Pinyin IME for typing in the RichTextBox causes FatalExecutionEngineError exception.
Html exported from RadRichTextBox will be shown in Outlook with some formatting issues related to lists. The text in a paragraph will be shown with the formatting of its bullet. The reason is that the content is exported to HTML as a styled list level which Outlook does not understand. The same applies to MS Word as well. This can also lead to formatting issues when the document is later imported in RichTextBox. You can check the attached screenshot for reference. Workaround: Change the styles to export as inline properties: htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
In MS Word, there is an option to show gridlines over the pages of the document. Implement such an option in RadRichTextBox as well.
Workaround: The attached project offers a simple custom implementation.
The content of the table cells seems to be rendered in the correct position while the borders are drawn above the continues section break.
The content of a page can be aligned vertically. In DOCX, this is a property of the section and is defined with the vAlign element. <w:sectPr> … <w:vAlign w:val="center" /> </w:sectPr>
When document fragment containing consecutive spans with same style is inserted with RadRichTextBox.InsertFragment method, and the document is with specific structure (which is not exactly known), NullReferenceException in HierarchicalIndex.GetBoxByHierarchicalIndex could be thrown when text is typed in specific places in the document. Workaround: Ensure that such spans are merged before creating the fragment: var document = xamlProvider.Import(xaml); document.MergeSpansWithSameStyles(); var fragment = new DocumentFragment(document); rtb.InsertFragment(fragment); --------------------------------------- Sample call stack: System.NullReferenceException at Telerik.Windows.Documents.HierarchicalIndex.GetBoxByHierarchicalIndex(DocumentLayoutBox documentBox, HierarchicalIndex hierarchicalIndex) at Telerik.Windows.Documents.DocumentPosition.RestorePositionFromBoxIndex(Nullable`1 raiseEvent) at Telerik.Windows.Documents.Model.RadDocumentEditor.InsertTextInternal(String text, Span currentSpanStyle, Boolean explicitAcceptsReturn) at Telerik.Windows.Documents.Model.RadDocumentEditor.InsertFromUI(String text, Span currentSpanStyle, Boolean acceptsReturn) at Telerik.Windows.Controls.RadRichTextBox.Telerik.Windows.Documents.UI.ITextInputCommandsHandler.InsertText(String text) at Telerik.Windows.Documents.UI.CaretTextInputHandler.InsertText(String text) at Telerik.Windows.Documents.UI.CaretTextInputHandler.HandleTextInsertedWithoutIme(RadDocument document, String text) at Telerik.Windows.Documents.UI.CaretTextInputHandler.CaretUI_TextInserted(Object sender, TextInsertedEventArgs e) at Telerik.Windows.Documents.UI.Caret.OnTextInserted(Object sender, TextInsertedEventArgs e) at Telerik.Windows.Documents.UI.Caret.OnTextChanged() at Telerik.Windows.Documents.UI.Caret.Caret_TextChanged(Object sender, TextChangedEventArgs e) ... Fix available in LIB Version 2018.2.813.
<p data-telerik-id="Paragraph637567542110611335">
<span data-telerik-id="Span637567542110611345">
Test
</span>
</p>
public class HiResDateTime
{
private static long lastTimeStamp = DateTime.UtcNow.Ticks;
private static readonly Regex digitsOnly = new Regex(@"[^\d]");
public static long UtcNowTicks
{
get
{
long original, newValue;
do
{
original = lastTimeStamp;
long now = DateTime.UtcNow.Ticks;
newValue = Math.Max(now, original + 1);
} while (Interlocked.CompareExchange
(ref lastTimeStamp, newValue, original) != original);
return newValue;
}
}
public static string UtcNowTicksString => digitsOnly.Replace(UtcNowTicks.ToString(), "");
}
When text with Code 128 font is rendered in RadRichTextBox, there are some unexpected behaviours: - Spaces are not rendered (they have special representation in Code 128). This issue will be reproduced for all fonts which define special (non-empty) representation of the space character. - During rendering, UI inserts "Left-to-Right Mark" character and "Right-to-Left Mark" character, which are not defined in the font and appear as .notdef glyph, which is white rectangle. This issue will be reproduced for all fonts which do not define these characters.
If there is a Span surrounded with annotation ranges in a table cell and the table has conditional table style, the text cannot be selected after import of such document. If the table has normal table style (not a conditional one) everything works as expected. - If the annotations are bookmark ranges (start and end), the text cannot be selected with double-click over the text. - If the text is hyperlink, the text could be selected with double-click, but when the selection is changed through the keyboard arrows, the same issue appears. The issue appears with Docx documents, in addition to the attached Xaml one, so the issue seems not to be related to the XAML serialization.
When the document contains headings with heading styles associated with numbering styles (numbered headings), and TOC field is inserted and/or updated in the document, the TOC items should contain the numbering which comes from the style. Instead, on update the numbering is lost and only heading text is included in the field result.
With the current implementation, when an image is selected, viewport is scrolled to the corresponding image document position: - In case of inline image, it moves to the end of the image, so that the image is fully visible. - In case of floating image, it moves to the position where image is anchored. The behavior of the MS Word (the view is not scrolled in such cases) is much more convenient.
This should be similar to the one in HtmlFormatProvider and RtfFormatProvider: Html/RtfImportSettings.FontSubstituting event.
When exporting with RtfFormatProvider (including when the users copy content), an additional \par tag is added at the end of the document. Workaround: Process the RTF after it is generated. Here is an example how to achieve it when copying: this.radRichTextBox.CommandExecuted += radRichTextBox_CommandExecuted; ... void radRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e) { if (e.Command is CopyCommand) { DocumentPosition end = this.radRichTextBox.Document.Selection.Ranges.Last.EndPosition; RadDocument clipboardDocument = ClipboardEx.GetDocument().ToDocument(); RtfFormatProvider provider = new RtfFormatProvider(); string rtfString = provider.Export(clipboardDocument); int indexLastParOpening = rtfString.LastIndexOf("{"); int indexLastParClosing = rtfString.IndexOf('}', indexLastParOpening); string newRtf = rtfString.Remove(indexLastParOpening, indexLastParClosing - indexLastParOpening + 1); Clipboard.SetData("Rich Text Format", newRtf); } }
Allow Span to be hidden when visualizing the document. For example, introduce a Span.IsHidden property. In MS Word, text is hidden using the Home -> Font -> Font -> Effects -> Hidden. In the RTF format, such text is preceded (marked) with a '\v' tag. In OOXML, the tag is <vanish/> Note: Hidden text is visualized with dotted underline when formatting symbols are shown. Hidden text is not exported to PDF.
Provide option for exporting InlineUIContainer and FloatingUIContainer as images to docx and RTF format.