When a hyperlink (and only the hyperlink) is selected, and the user types over the selection, the hyperlink is deleted, and text with locally set blue fore color and blue underline is inserted. Instead, the hyperlink should be preserved, and just its link text should be modified.
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.
The TxtFormatProvider always imports the document with UTF8 encoding. It will be great if users could change this setting in order to import document with different encodings.
The caret gets a wrong size when positioned on annotation start/end.
Currently, RadRichTextBox only imports from HTML documents tables with spacing between cells, but it does not export tables with such style. It seems like the border-collapse: collapse value defined in the Table Normal style overrides the border-spacing value, which is applied to the cells. As a workaround, the document styles can be omitted from the exported HTML and the styling can be exported inline be changing the ExportSettings of HtmlFormatProvider: provider.ExportSettings.StylesExportMode = StylesExportMode.Inline; provider.ExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles;
Undoing changes to words wrapped in annotation ranges throw InvalidCastExceptions as AnnotationRangeStarts are casted to AnnotationRangeEnd. Steps to reproduce: 1. Add a bookmark to a word 2. Add a bookmark to the following word in the document 3. Use the find dialog to highlight those two words 4. Bold the text 5. Press Ctrl+Z to undo Observed: Repeated InvalidCastException dialogs Fix available in LIB Version 2018.1.430.
Currently there are three places in the UI which contain a list of font sizes which could be applied to the content, and all of them could be customized separately: - RadRichTextBoxRibbonUI - could be customized by directly editing the content of the ribbon in the XAML file. - FontPropertiesDialog - could be customized by replacing the whole dialog (as SDK is available: https://github.com/telerik/xaml-sdk/tree/master/RichTextBox/CustomFontPropertiesDialog ), or a little hacky approach using the FindName method: ((ListBox)((Control)this.radRichTextBox.FontPropertiesDialog).FindName("fontSizeListBox")).ItemsSource = new List<double> { 10, 14, 16, 18, 20 }; - SelectionMiniToolBar - could be customized by changing the template of SelectionMiniToolBar Provide API which allows customization at a single place. This API could be similar to (or even extension of) the already available Telerik.Windows.Document.Layout.FontManager class.
When document with TOC field is exported to PDF, the hyperlinks in the TOC field are exported with blue fore color and blue underline (with the default hyperlink styling). Instead, they should be exported with the fore color visible in the document.
Workaround: Clear the hyperlink style from the spans inside the TOC:
var firstTocRange = this.radRichTextBox.Document.EnumerateChildrenOfType<FieldRangeStart>().Where(frs => frs.Field is TableOfContentsField).First();
this.radRichTextBox.Document.Selection.SelectAnnotationRange(firstTocRange);
foreach (var spanLayoutBox in this.radRichTextBox.Document.Selection.GetSelectedBoxes<SpanLayoutBox>())
{
spanLayoutBox.AssociatedSpan.Style = null;
}
If a document does not have definition for font size in all levels of the font hierarchy, then all runs that do not have font size set locally, will be imported with font size 9.5. In Microsoft Word, in this case, the font size value is 10. Workaround: Set the FontSize of the default document style after the document is imported: RadDocument reportDocument1; using (FileStream inputStream = new FileStream(@"C:\Original.docx", FileMode.Open)) { reportDocument1 = provider1.Import(inputStream); reportDocument1.StyleRepository[RadDocumentDefaultStyles.DefaultDocumentStyleName].SpanProperties.FontSize = Unit.PointToDip(10); } using (FileStream output = new FileStream(@"C:\test.docx", FileMode.OpenOrCreate)) { provider1.Export(reportDocument1, output); }
The "Text Wrapping" string, used in the FloatingBlockPropertiesDialog lacks translations in Spanish and French. In the English and Turkish values, a space is missing between the words. Fix available in LIB Version 2018.1.416.
Inserting image inline from stream changes its size dramatically. Run the following code to reproduce: RadDocument document = new RadDocument(); RadDocumentEditor editor = new RadDocumentEditor(document); //editor.Insert("some text"); using (FileStream stream = File.OpenRead(@"C:\Temp\picture.jpg")) { editor.InsertImage(stream, ".png"); } File.WriteAllBytes($@"d:\Temp\test\test_doc.pdf", new PdfFormatProvider().Export(document)); The issue is observable after 2017.2.614.
There are a number of Bitmap objects that are not disposed. Changing this behavior could improve the memory usage when exporting PDF documents.
The List Override Table contains definitions that override the properties of another list definition.
When pasting a big image in RichTextBox, it is pasted with its original size. It should be resized so it can fit on the page. Similar logic is available in the InsertPictureCommand. Workaround: private void RadRichTextBox_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; var bitmapSource = Clipboard.GetImage(); if (bitmapSource == null) { return; } Padding sectionmargin = this.radRichTextBox.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.radRichTextBox.Document.LayoutMode == DocumentLayoutMode.Paged) { Section currentSection = this.radRichTextBox.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; var pageSize = (SizeF) currentSection.GetType().GetProperty("ActualPageSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(currentSection, null); 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; Size size = new Size(width, height); ImageInline imageInline = new ImageInline(new WriteableBitmap(bitmapSource)); imageInline.Size = size; this.radRichTextBox.ActiveDocumentEditor.InsertInline(imageInline); } }
- Localization for "Simple text" in the Define New List Style dialog and Define New Style dialog at RadRichTextBox. - Levels (from 1st to 9th) are hardcoded in dialog's code behind and cannot be localized. (these are the items in the 'Apply Formatting to' comboBox)
When the background is defined for a table or a cell, it should be inherited by the paragraphs inside. Currently, the paragraphs are with the background defined in the default style.
When the position on which the users right-click is an annotation start or end marker, the context menu doesn't provide suggestions about spellcheck errors. Steps to reproduce: 1. Type "The greater the better" in RadRichTextBox with enabled spellchecking 2. Turn on track changes 3. Move the caret to the 't' of "greater" 4. Insert 't' so the word becomes wrong 5. Right-click on the 't' letter inserted in step 4 Observed: The context menu doesn't show suggestions for fixing the misspelled word Expected: The context menu should suggest a fix
An OutOfMemoryException is thrown on export to PDF when the compression mode is set to Deflate. Regression, introduced in R1 2017. Workaround: Change the ImagesCompressionMode to one of the other available options to avoid using the Deflate
Allow the custom fields inserted in a child document, like header/footer/comment etc, to access properties from the main document of RadRichTextBox.
When deleting all content (e.g. Select All [CTRL+A] + Delete [Del]) in the document, it would be convenient for the user to preserve all formatting (local span formatting + local paragraph formatting + style) applied on the last paragraph. This will ensure that the user will continue edit the document with last current font, font family, etc. If this operation is applied on an empty document, though, the styling of the single paragraph should be reset to the defaults for the document.