Search code examples
c#rtfrich-text-editor

Creating Rich Text Templates


I need to create a Rich Text Format (RTF) template file I can pass data through which generates the RAW rich text (that can then be saved).

  • I see a TON of HTML editors...I don't want that.
  • I need something to create the actual RTF...raw!
  • I will save that raw RTF as a template

Having a hard time finding something. Thanks

FOR EXAMPLE:
I need the raw RTF for a template...I DO NOT want HTML

{\rtf1\ansi\ansicpg1252\uc1\deff0{\fonttbl
{\f0\fnil\fcharset0\fprq2 Arial;}
{\f1\fswiss\fcharset0\fprq2 Tahoma;}
{\f2\froman\fcharset2\fprq2 Symbol;}}
{\colortbl;}
{\stylesheet{\s0\itap0\nowidctlpar\f0\fs24 [Normal];}{\*\cs10\additive Default Paragraph Font;}}
{\*\generator TX_RTF32 19.0.542.500;}
\paperw7315\paperh15840\margl0\margt0\margr0\margb0\deftab1134\widowctrl\lytexcttp\formshade\sectd
\headery720\footery720\pgwsxn7315\pghsxn15840\marglsxn0\margtsxn0\margrsxn0\margbsxn0\pgbrdropt32\pard\itap0\nowidctlpar\plain\f1\fs20 MED BILL INV#  28989293\par }

Solution

  • Sorry... Your question is not very clear...

    What about:

    richTextBox1.SaveFile(filename.rtf);
    

    If you open that file with Notepad you'll see something like:

    {\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
    \viewkind4\uc1\pard\b\i\f0\fs36\par
    }