In MS Word there are several options available in the Advanced Find dialog that are not available in the RichTextBox, the two most requested by our users are "Match case" and "Find whole words only".
"Win32Exception (0x80004005): Not enough storage is available to process this command" is thrown when multiple RadDocument instances are created in background threads. This is due to the fact that RadDocument contains MailMergeDataSource object, which is DependencyObject. When multiple dependency objects are created in different threads, they are not property freed by thread's Dispatcher. Workaround 1: Microsoft provided workaround in a bug report here: https://connect.microsoft.com/VisualStudio/feedback/details/620588/system-componentmodel-win32exception-0x80004005-not-enough-storage-is-available-to-process-this-command , namely: ------------------------------ Put the following code: Dispatcher dispatcher = Dispatcher.CurrentDispatcher; dispatcher.BeginInvokeShutdown(DispatcherPriority.Normal); Dispatcher.Run(); anywhere in the background thread processing the RadDocument. ----------------------------- Workaround 2: Use pooling of the used threads. The problem is that Task Parallel Library (which has built-in pooling) does not use STA threads by default, but this can be achieved by using custom TaskScheduler (attached, the code is get from here: https://code.msdn.microsoft.com/ParExtSamples ): var parallelOptions = new ParallelOptions() { TaskScheduler = new StaTaskScheduler(Environment.ProcessorCount) }; Parallel.For(0, 10000, parallelOptions, cc => { var document = new DocxFormatProvider().Import(data); byte[] pdfBytes = new PdfFormatProvider().Export(document); };
Currently, StylesGallery and TableStylesGallery cannot be resized. Internally they contain RadRibbonGallery, which itself expose ViewPortWidth property controlling the width, so this just have to be exposed.
On export to HTML tab stops are converted to non-breaking spaces ( ). Sometimes the width of the all nbsp-s becomes different than the width of the tab stop. When document which contains grid-like data is exported to HTML its columns are not aligned.
Hi Telerik,
We are converting XAML content into PDF file with below code.
private byte[] Xaml2Pdf(string xamlContent)
{
try
{
XamlFormatProvider xamlFormatProvider = new XamlFormatProvider();
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
PdfExportSettings exportSettings = new PdfExportSettings();
exportSettings.ContentsCompressionMode = PdfContentsCompressionMode.Automatic;
exportSettings.ContentsDeflaterCompressionLevel = 9;
exportSettings.DocumentInfo = new PdfDocumentInfo() { Producer = "ALIS", Author = "ALIS", Creator = "ALIS" };
exportSettings.ImagesCompressionMode = PdfImagesCompressionMode.Automatic;
exportSettings.ImagesDeflaterCompressionLevel = 9;
pdfFormatProvider.ExportSettings = exportSettings;
byte[] content = pdfFormatProvider.Export(xamlFormatProvider.Import(xamlContent));
return content;
}
catch
{
throw;
}
}
Adding bookmarks with the same name programmatically always returns the first one in case use attempts to navigate to it using the Bookmarks dialog.
Workaround: Remove the bookmark before adding a new one with the very same name.
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;
When a text doesn't specify font explicitly with \fN tag, and default character properties (\defchp) are not specified, or are specified but without font set, the font of the text is visualized with the default font - Verdana. Instead, the default font for the document should be used - defined with \deffN tag.
The exception is thrown by the SystemFontsManager internal class from Telerik.Windows.Documents.Core, so it can observed when using RadPdfViewer, RadRichTextBox, RadSpreadsheet. The reason is not clear, posssible causes are: - Corrupted fonts after upgrade from Windows XP - Enabling of Block untrusted fonts feature (https://docs.microsoft.com/en-us/windows/threat-protection/block-untrusted-fonts-in-enterprise ) The call stack is as follows: System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Core.Fonts.SystemFontsManager' threw an exception. ---> System.IO.FileNotFoundException: Unable to find the specified file. at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr) at MS.Internal.Text.TextInterface.FontList.get_Item(UInt32 A_0) at MS.Internal.Text.TextInterface.FontList.FontsEnumerator.get_Current() at MS.Internal.FontFace.TypefaceCollection.Enumerator.get_Current() at System.Windows.Media.Fonts.TypefaceCollection.<GetEnumerator>d__11.MoveNext() at Telerik.Windows.Documents.Core.Fonts.SystemFontsManager..cctor() Workaround: Manually delete all registry key values in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts pointing to files outside of the Fonts folder.
In some cases when an image is copied from an external source and pasted in the rich text box, the image is not displayed. This is caused by the Clipboard.GetImage() method used internally by the control. To work this around, you can subscribe for the CommandExecuting event of RadRichTextBox and manually get the image from the clipboard. private void Rtb_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { PasteCommand command = e.Command as PasteCommand; if (command != null && (Clipboard.GetData("DeviceIndependentBitmap") != null)) { //Get the image stream from the clipboard. //You can check the following blog post for an approach which you can use to get the image properly: //https://www.thomaslevesque.com/2009/02/05/wpf-paste-an-image-from-the-clipboard/ this.radRichTextBox.InsertImage(imageStream, "jpeg"); e.Cancel = true; } }