Use attached to reproduce.
When there is a hyperlink enclosed in another annotation (e.g comment, bookmark, read-only range), and the user moves the caret position just before or just after the hyperlink, and starts typing there, the text is inserted with the style of the hyperlink (by default, blue with blue underline). Instead, the text should be inserted without such style.
To reproduce: run the project, load the document available in the project's folder and start clicking the words. You will notice that the cursor is shifted on the right. Workaround: don't enable the RightToLeft property.
Provide functionality allowing a document to be thumbnailed. The customers should be able to export a document to an image. Workaround: Use attached project.
When you load a HTML file where the image is not loaded properly and you try to export RadRichTextEditor's document to a pdf, an error occurs. Workaround: If the image doesn't exist you can skip loading in the document. Thus, exporting to pod at a later moment won't produce an error. You can use the HtmlImportSettings.LoadImageFromUrl event and handle the image loading: Sub New() ' This call is required by the designer. InitializeComponent() Dim provider As HtmlFormatProvider = New HtmlFormatProvider() Dim htmlImportSettings As HtmlImportSettings = New HtmlImportSettings() AddHandler htmlImportSettings.LoadImageFromUrl, AddressOf LoadImageFromUrl provider.ImportSettings = htmlImportSettings Using inputStream As FileStream = File.OpenRead("..\..\Email HTML.html") Me.RadRichTextEditor1.Document = provider.Import(inputStream) End Using End Sub Private Sub LoadImageFromUrl(sender As Object, e As LoadImageEventArgs) e.Handled = True End Sub
When CJK text (Chinese, Korean, Japanes) is copied from WordPad and paste into RadRichTextBox text, the characters are imported incorrectly (as '?' and as different characters). The same applies if WordPad document containing CJK is imported from RTF. The problem is related to the specified \fcharset134 RTF tag, which is not properly interpreted.
When the content of an entire row is copied and the caret is inserted in the left most column of a row, then the content of each cell in that row should be overwritten with the contents in the clipboard when pasted. When such content is pasted just after a table, new row is added and filled with values. When such content is pasted in paragraph, new table is created.
How to reproduce: check the attached gif file
Please refer to the attached screenshots. A sample .docx file is attached. Just load it in RadRichTextEditor.
How to reproduce: create a table with 1px of the inner borders and 3px of the outer borders. The attached screenshots demonstrates the issue. A similar result can be also observed with other widths as well.
When you have more than one RadRichTextEditor controls on the form and you have selected text in both of theme, only the focused RadRichTextEditor should show the selection.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is SaveCommand) { DocumentPosition initial = this.radRichTextEditor1.Document.CaretPosition; DocumentPosition start = new DocumentPosition(initial); DocumentPosition end = new DocumentPosition(initial); var spans = this.radRichTextEditor1.Document.EnumerateChildrenOfType<Span>(); foreach (var span in spans) { if (span.FontStyle != FontStyle.Regular) { continue; } start.MoveToInline(span); end.MoveToEndOfDocumentElement(span); this.radRichTextEditor1.Document.Selection.AddSelectionStart(start); this.radRichTextEditor1.Document.Selection.AddSelectionEnd(end); this.radRichTextEditor1.RichTextBoxElement.Commands.ChangeFontFamilyCommand.Execute("Calibri"); } this.radRichTextEditor1.Document.CaretPosition.MoveToPosition(initial); } }
To reproduce: - Load a right to left document with Hebrew characters. - Export it to PDF - The characters' position is not correct.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, CommandExecutingEventArgs e) { if (!(e.Command is PasteCommand)) { return; } DocumentFragment res = ClipboardEx.GetDocumentFromClipboard("RadDocumentGUID"); if (res == null) { foreach (ClipboardHandler settings in ClipboardEx.ClipboardHandlers) { res = ClipboardEx.GetDocumentFromClipboard(settings.ClipboardDataFormat, settings.ClipboardStringFilter); } } if (res == null) { e.Cancel = true; System.Drawing.Image bitmapSource = Clipboard.GetImage(); if (bitmapSource == null) { return; } Telerik.WinForms.Documents.Layout.Padding sectionmargin = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection.ActualPageMargin; double originalPixelWidth = bitmapSource.Width; double originalPixelHeight = bitmapSource.Height; if (originalPixelWidth == 0 || originalPixelHeight == 0) { originalPixelWidth = 10; originalPixelHeight = 10; } double width = originalPixelWidth; double height = originalPixelHeight; if (this.radRichTextEditor1.Document.LayoutMode == DocumentLayoutMode.Paged) { Section currentSection = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; Telerik.WinForms.Documents.Model.SizeF pageSize = (Telerik.WinForms.Documents.Model.SizeF)currentSection.GetType().GetProperty("ActualPageSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(currentSection); double maxWidth = pageSize.Width - (sectionmargin.Left + sectionmargin.Right); double maxHeight = pageSize.Height - (sectionmargin.Top + sectionmargin.Bottom); width = Math.Min(maxWidth, width); height = Math.Min(maxHeight, height); } double ratio = originalPixelWidth / originalPixelHeight; width = Math.Min(width, height * ratio); height = width / ratio; Telerik.WinControls.RichTextEditor.UI.Size size = new Telerik.WinControls.RichTextEditor.UI.Size(width, height); ImageInline imageInline = new ImageInline(new WriteableBitmap(bitmapSource)); imageInline.Size = size; this.radRichTextEditor1.RichTextBoxElement.ActiveDocumentEditor.InsertInline(imageInline); } }
Workaround: Handle the CommandExecuted event and change the font family after executing the paste command: private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e) { if (e.Command is PasteCommand) { foreach (var p in this.radRichTextEditor1.Document.EnumerateChildrenOfType<Paragraph>()) { if (p.IsInList) { var list = this.radRichTextEditor1.Document.ListManager.GetDocumentListById(p.ListId); list.ActualStyle.Levels[0].FontFamily = new Telerik.WinControls.RichTextEditor.UI.FontFamily("Symbol"); } } } }
Pressing Tab/Shift+Tab when caret position is at the beginning of a paragraph should change current paragraph FirstLineIndent instead of LeftIndent. First line indent should be changed to Document.DefaultTabWidth step. Workaround: private void RadRichTextEditor1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData != Keys.Tab) { return; } this.radRichTextEditor1.Insert("\t"); e.SuppressKeyPress = true; e.Handled = true; }
Add support for All Capitals (All caps) and Small Capitals (Small caps) run property. MS Word has such option in Home -> Font -> Dialog Launcher -> Font -> All Caps/Small Caps. All letters of such runs are visualized as capital letters. The corresponding elements in OOXML are <w:caps /> and <w:smallcaps />.