Ask the Expert

Developing an RTF writer

I want to develop a small RTF writer in C#. Do you have any suggestions for how to get started?
I would suggest reading through the RTF specifications. The MSDN Library would be my first stop, refer to this link ms-help://MS.MSDNQTR.2003FEB.1033/Dnrtfspec/html/rtfspec.htm in the MSDN Library (you may need to change your filter in the help files to "No Filter" or "Platform SDK"). The RTF format is rather complex, but it is not all that complicated once you get your feet wet. Also do a Google search for RTF and C#, that should get you a load of good links. The CodeProject ( has several very good articles about using RTF in C#, so you might want to check them out also.

Once you get the format and specifications figured out, and know what you want to do. You could write a custom class, or inherit from one of the writer base classes in the .NET Framework. Look at the StreamWriter or TextWriter classes for more information. Creating a custom implementation using the RTF format from one of these classes would be a very robust mechanism for your goal.

This was first published in September 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: