SourceForge LogoCPP2RTF


Version 0.23 of CPP2RTF is out. This is a bug-correcting release (it would crash if the default keyword file was not found). Additionally, specifying a non-existent keyword file now prints a warning, instead of stopping the program.


CPP2RTF is a small console programs that I wrote to build listings of C++ source code in RTF format (which many word processors understand), so that they can be printed with highlighting on a B&W printer. Its features include:

This program is Free Software, licensed under the GNU General Public License.

As it is a free software, its source code is available. Precompiled binaries for Windows and Cygwin are also available. It is hosted on SourceForge, a free service to Open Source developpers.

Here is an example of the results you can get using CPP2RTF. It is the main file of the program itself.


CPP2RTF version 0.23 by Xavier Nodet
  Copyright (c) 1999-2002
  The home page for this project is
  Please report bugs/suggestions to

Parses the files specified (awaiting CPP sources) and outputs the
listings in RTF format. Uses, if available, the keyword file (one
per line) indicated by the environment variable $(CPP2RTFKEYWORDFILE),
or the file $(HOME)/.usertype.dat (the first one that exists).

Usage : 
   cpp2rtf [options] cppFile1 cppFile2...
Options : 
   -h,   --help          Print this screen.
   -v,   --version       Print the version of the program.
   -f,   --filter        Act as a filter and ignore specified files.
   -nl,  --nolandscape   RTF output is NOT to be set up in landscape
                         mode, with two columns.
   -k,   --keywordfile   Next word is a keyword file name to be used
                         instead of the default one.

Xavier Nodet,, last updated on 2002-12-17