Create different options for pasting(keep formatting, merge formatting, use destination styles). At this point, the document default styles are not copied in the document fragment, thus their loss is observed. When DocumentInheritsDefaultStyleSettings is true and the font settings are like set to different font size/font family, copied text is pasted to MS Word with Verdana font, size 12. Loss of formatting is also observed when copying from RadRichTextBox and pasting in MS Word - the default styles differ.
Right click image > text wrapping > more layout options > text wrapping tab
Word supports "Largest Only" but RichTextBox only has both, left, and right.
This can be reproduced with the provided .docx. In Word the image floats in the empty space below the text but the RichTextBox has it inline and overlapping text.
Removing the rectangle from around the image in the source document has no affect.
Currently floating images specified using the VML shapes are imported as non-floating, for example:
<v:shape id="_x0000_s1026" type="#_x0000_t75" style="height:180.25pt;margin-left:62.25pt;margin-top:1.65pt;position:absolute;width:180.25pt;z-index:251658240" o:preferrelative="t">
<v:imagedata r:id="rId4" />
</v:shape>
When importing from a .docx the RichTextBox is adding a blank line for each continuous section break. You can see this in the attached file - in the RichTextBox there is an extra line between sections that does not exist in the source word document.
Hi Guys,
Our application works with a document storage and we use RadRichTextBox to allow users edit and view the documents. Unfortunately, many documents cannot be opened due to the following exception we get:
Unable to cast object of type 'Telerik.Windows.Documents.Model.FieldRangeStart' to type 'Telerik.Windows.Documents.Model.AnnotationRangeEnd
As result we receive complains from our users. Could you please facilitate with solving it?
I have attached a simple test application with the problematic document as well the stacktrace.
Best regards,
Yaroslav
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); };