Search code examples
c#uwprichtextboxcomponentone

convert RTF to HTML from ComponentOne RichTextBox?


The section Read and Write Rich Text Format Documents of this online article of UWP edition of ComponentOne reads: you can use it to convert RTF to HTML and vice versa.

I went through their API document and did not find any code example of such functionality and could not figure out which method from their APIs to use.

Question: Could you please provide (or link to an online sample) for converting RTF to HTML from RichTextBox control of ComponentOne's UWP Edition? I'm using C# but VB code also be fine.


Solution

  • ComponentOne you can use it to convert RTF to HTML and vice versa.

    You could convert between HTML and RTF using the RtfFilter library. And you could also get the code sample with this link.

    rtfBox.Text = new RtfFilter().ConvertFromDocument(richTextBox.Document);
    

    enter image description here