Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can transform HTML code to rtf Code to display in Rich Text Box programmatically?

If the user give HTML code and how can it show back to rich text box ? Any suggestions ?
Posted

This is a commercial product, but it might be just what you were looking for: http://cutesoft.net/example/editRTF.aspx[^].

To get preciser answers you might want to consider tagging your question either ASP.net or WinForm.

Cheers,
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-Mar-11 3:38am    
Not bad (my 5), but commercial product may be not suitable at all, especially for Web applicationss, mostly because it is closed-source. Why? There is a good CodeProject article.
Please see my Answer.
--SA
I don't like commercial product for this task, and not just because of money, more because it is closed code.

You can learn how to do it by yourself. Look at this CodeProject article: Writing Your Own RTF Converter[^].

Now, I would advice you do now allow the user to post all thinkable HTML code. More exactly, you could filter out all tags except some limited set you allow in your document. It will make conversion to RTF easy and will add some safety to your site.

Alternatively, I would recommend keeping all the documents in HTML (better yet, XHTML) without using RTF. HTML is much better suited for Web applications.

—SA
 
Share this answer
 
Comments
Manfred Rudolf Bihy 30-Mar-11 3:40am    
Good answer! 5+
Sergey Alexandrovich Kryukov 30-Mar-11 3:56am    
Thank you, Manfred.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900