How to display RTF text in to tinyMCE editor - c#

I am using tinyMCE editor. I have rtf formatted string in database column which I want to show in the browser editor i.e. tinyMCE. So that, user will edit the text as he wants. But for that I found I need to convert the rtf string in to xml to see it, since my tinyMCE is showing xmls properly. I am able to show the text from rtf string but I misses out the formatting like bold text, red colored text, \n etc. I want to retain all this formatting. How shall I retain the formatting or how shall I display the rtf text with the formatting or how shall I convert rtf text in to xml properly? I want to display rtf text like I am saving it in some rtf file and opening that file in ms word or open office word that way I want to see the format. rtf is Rich Text format.

You should convert your RTF to HTML and use that for TinyMCE, here is a code project article that will get you started :
http://www.codeproject.com/Articles/27431/Writing-Your-Own-RTF-Converter

Related

C# - Convert HTML String to formated plain text

Is there a way to convert a html string for example content saved using a wysiwyg editor such as tinyMCE to formatted plain text i.e. retain line breaks.
I've been looking at the HTML Agility Pack but there are no examples that show how you can achieve something like the above.
Basically I want send content saved using tinyMCE in an email notification but i need to ensure any styles and formatting saved by tinyMCE don't break the styles in my HTML email hence the need to convert the content to plain text.
Any examples would be appreciated.

changing format of RichTextBox without selecting any text

I would like to create a Richtextbox which load a huge file (several pages of text in some format) and based on format it formats the text (let's say it display html).
I found how to change format of text using selection, but that is very slow and resource expensive. Is there a way to append a preformatted text to Rich Text Box? So that I can format each element and then append it.
This might help you if not the answer you are looking for
But RichTextBox.CanPaste Method determines whether you can paste information from the Clipboard in the specified data format. Please see link the for the System.Windows.Forms.DataFormats it will support

ajaxcontroltoolkit htmleditor: both cleanup and keep the format?

In an ajaxcontroltoolkit htmleditor, I would like to load an html formatted text from a file, keep its formatting, edit it and resave it.
While editing the text, if the user pastes in some text from ms word, I'd like to strip its formatting (but keep the formatting of the text in the htmleditor)
In my tries I either keep both formattings (formatting in editor anĀ formattingĀ from word), or loose both of them.
Is there a way to only strip the formatting from the pasted text?

put \\scaps in RTF for small caps

I'm using dynamic RichTextBox control in C# 2.0 and I want to insert "\scaps" in RTF so that if the file is saved programatically and then opened in MS-Word certain text be seen smallcaps.
Can anyone tell me the code as how to insert the tag?
Well, you can access the rich text directly through the Rtf property on the rich text box.

HTML text into microsoft word document bookmark

I have a small web rich text editor that have some features like bolb, italic, and so on...
The text generated is html, and I would like to insert that text inside a word document bookmarks.
Putting the text into the bookmarks is not a problem. However, I have problems because of the text format (with the bolds for example).
Is there a fast way to "convert" text from html to doc, or just a way to include html into a word document?
This is an exemple:
<p>Hello <strong>world<strong/></p>
This text should just appear "Hello World" in the word bookmark.
Thanks in advance.
Enclosing the html in ... <\body> tags should do the trick.

Categories

Resources