Reputation: 37231
I'm trying to create a notepad/wordpad clone. I want to save it in .rtf format so that it can be read by wordpad. How do I save a do this in C#?
Upvotes: 0
Views: 1070
Reputation: 144182
Assuming you are trying to do this yourself for learning purposes, you don't want to use a library to do it for you:
Basically you need to write a program which holds in memory either a string with RTF markup, or a DOM-like data tree. Using the RTF specification, you should write a flat (text) file marked up properly and with a .rtf extension. Just the same as if you were writing an HTML file.
Upvotes: 2
Reputation: 15609
RTF SpecLink
create the xml spec based on their api and you can make your app compatible with wordpad, word etc.
Upvotes: 0
Reputation: 7146
Correct me if I'm wrong, but if you're using the RichTextBox control, you can just use the RichTextBox.SaveFile method to accomplush this. Just a guess though that you mean doing it without using that control.
Upvotes: 1