How to create RTF from plain text (or string) in C#?

Jerry picture Jerry · Sep 10, 2012 · Viewed 25.6k times · Source

Could anyone please help me to create RTF from string in C#?

I save all the formats (bold, italic, etc) in a customized class.

Jerry

Answer

Dmytro picture Dmytro · Sep 10, 2012

As the simplest option, you can use RichTextBoxControl in winforms application.

richTextBox1.SaveFile(@"C:\temp\test.rtf", RichTextBoxStreamType.RichText);