Unplanned
Last Updated: 31 May 2021 08:30 by ADMIN
ADMIN
Todor
Created on: 24 Nov 2014 11:28
Category: RichTextBox
Type: Feature Request
25
RichTextBox: Implement conversion between RadDocument and RadFlowDocument
Add a way to convert between RadRichTextBox's RadDocument and RadWordsProcessing's RadFlowDocument. 

This will enable integration scenarios between the two products, including using RadWordsProcessing's format providers for import and export.
7 comments
ADMIN
Dimitar
Posted on: 31 May 2021 08:30

Hello Joshua,

The DocFormatProvider is part of the DocumentProcessing library which is a separate library that is not connected to the RadRichTextBox. Currently, the possible solution is to use the DocumentProcessing library to convert the document to DOCX and then open it in RadRichTextBox. 

Another approach is demonstrated here as well: xaml-sdk/RichTextBox/DocFormatProviderDemo at master ยท telerik/xaml-sdk

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Joshua
Posted on: 29 May 2021 20:31
The new DocFormatProvider produces a RadFlowDocument which is not compatible with RadRichTextBox. I'm confused why it was done this way because DocxFormatProvider produces a RadDocument which IS compatible. Regardless, it's another reason to implement this feature formally.
ADMIN
Dimitar
Posted on: 10 Dec 2020 11:11

Hi Hilton,

Yes, this is still not implemented, it has a lot of votes, I am sure that it will be implemented in one of the future releases.

 I can suggest a workaround that uses the docx format for the conversion for now: 

private void RadButton_Click(object sender, RoutedEventArgs e)
{
    var rtbProvider = new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider();
    var wordsProcessingProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();

    var radDocument = radRichTextBox.Document;

    var docBytes = rtbProvider.Export(radDocument);
    var flowDocument = wordsProcessingProvider.Import(docBytes);
}

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hilton
Posted on: 09 Dec 2020 19:52
4 years later and seems this still hasn't been added. Sure could use it about now.
ADMIN
Tanya
Posted on: 13 Oct 2016 09:03
Hi Peter,

You can implement this scenario using the HtmlFormatProvider of RadRichTextBox. 

In order to use this provider, you need to add a reference to the Telerik.Windows.Documents.FormatProviders.Html assembly and a using directive for the Telerik.Windows.Documents.FormatProviders.Html namespace. 

You might find helpful to check the Import/ Export article of RadRichTextBox for more information about the functionality: http://docs.telerik.com/devtools/wpf/controls/radrichtextbox/import-export/features-import-export

Regards,
Tanya 
Peter
Posted on: 10 Oct 2016 19:09
I really want from RadFlowDocument to RadDocument so i can set my RadRichTextBox.Document = htmlFormatProvider.Import("my html text);

Is there another way to do this for now?
Kishore
Posted on: 10 Mar 2015 15:30
Please add this feature to WinForms too. Thanks,