Question

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#?

Was it helpful?

Solution

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.

OTHER TIPS

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.

RTF SpecLink

create the xml spec based on their api and you can make your app compatible with wordpad, word etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top