rtfdtohtml - convert RTF and RTFD files to HTML pages


[-G] [-gif|-png] [-jpeg] [-head] [-href] [-blue] [-html2] [-index] [-no-li] [-tables] [-nav file] [-output dir] [-scale factor] [-version] file ...


The rtfdtohtml program may be used to translate existing documents from the Rich Text Format to HTML. The program knows how to handle most of NeXT's extensions to the RTF format, e.g. links and inline graphics. (See section Conversion Details for more information.)

All generated files are placed by default in the same directory as the corresponding source file. A different directory may be specified with the -output command line option as described in the next section. The output filename will be created by appending the suffix .html to the source filename, except for RTFD files like file.rtfd (which really is a directory containing a TXT.rtf file). In this case the output will be written to the file file.rtfd/index.html.

File arguments given on the command line may be either RTF or RTFD files, or C / C++ / Objective-C source files that contain RTF information. All file arguments that are not RTF or RTFD files will be ignored.


Rtfdtohtml currently supports the following options:

-G or --no-graphics
This option disables all image conversions. It is mainly useful if only the text of a document has changed and you want to avoid recreating all the images. This saves a lot of time on most files.

-gif or --gif
All EPS images will be converted to interlaced GIF format. This is the default unless the -jpeg option has been given, in which case JPEG is the default format.

-png or --png
All EPS images will be converted to PNG format.

Read for details on the PNG format and why PNG is better than GIF.

-jpeg or --jpeg
All TIFF images will be converted to progressive JPEG format. The default format for TIFF images is the format used for EPS images (either GIF or PNG).

-head or --heading
This option determines the type of tags to use for headings in HTML. By default, <FONT> will be used. The <H1> ... <H6> tags of HTML-1.0 may be enabled with the -head or -html2 option.

-href or --href
An alternate style for processing the links to other files or URL's can be enabled by giving this option. See below for details.

-blue or --blue
Convert text (which may include images) coloured in blue into a hypertext link if it contains angle brackets (<...>). All text inside the first pair of brackets is taken as the target of the link and will not appear in the document text.

-html2 or --html2
If you want to avoid the use of tables (HTML-3.2) in the generated files, you should set this option. Note however that some documents will look strange without tables. The <CENTER> tag will still be used, as most HTML-2.0 browsers support it.

-index or --index
Build an index file by collecting all headings and definitions from the documents listed on the command line. The references will be sorted alphabetically (ignoring case and special characters) and will be written to the file index.rtf.html.

-no-li or --no-lindent
Ignore all settings for first- and left-indent in the RTF(D) document. This may be useful if the output contains too many indented lines.

-tables or --tables
This option makes the converter use tables wherever it is possible, instead of where they are considered appropriate. Documents may look better or worse when this option is given, so you have to try for yourself.

-nav file or --nav-file file
Add navigation panels to the top and bottom of each created document. This requires a file argument describing the logical structure of the document tree. Read the section Navigation Panels for more information.

-output dir or --output dir
Use this option to select a different destination directory for the converted HTML and image files. The program will automatically create the complete target directory structure, if necessary. If the given dir does not exist, it is created. However, its parent directory must already exist.

-scale factor or --scale factor
If the default font size mapping produces too large or too small fonts, all font sizes may be scaled by the given factor. This option does not affect the size of inline images.

-version or --version
Print the version number of rtfdtohtml and the copyright information to standard output and exit immediately.

Conversion Details

Normal text will be reproduced unchanged in the output, with a few exceptions:

Navigation Panels and Titles

Rtfdtohtml can automatically add navigation panels to the top and bottom of each created document. This feature requires a file defining the relationships with other documents; it must follow the -nav option on the command line.

This structure file may contain zero or more lines of the form:

        # comment
        <tag>: <value>
        <document> [title="<some text>"]

Empty lines and lines starting with `#' will be ignored. The following tags are currently defined (the colon must immediately follow the tag name):

email address for the Feedback button

name or URL of an index file

string to use on the Previous button

string to use on the Next button

string to use on the Up button

string to use on the Contents button

string to use on the Index button

string to use on the Feedback button

These strings are inserted verbatim into the document and may contain arbitrary HTML markup, including images and animations. Remember this when you try to insert a literal &, < or >.

A document can be a simple filename or a URL, optionally followed by blocks defining subsections of the document:

            <document1> [title="<some text>"]
            <document2> [title="<some text>"]

If a value for the title attribute has been given, it will be used as the document title instead of the default value (the basename of the input file). Filenames or URL's may have to be surrounded by double quotes to preserve special characters or whitespace, use \\ and \" to insert a literal \ and " into a quoted string. Relative pathnames must be specified relative to the top level directory of the document tree. The first filename given should contain the table of contents. For example:

        Chapter_1.rtfd          title="Introduction"
        "Chapter 2.rtfd"        title="New Features"
        "Chapter 3.rtf"         title="Examples"


Rtfdtohtml recognizes these environment variables, if set:

attributes of the <BODY> tag (default "bgcolor=White")

level of gamma correction for the converted images (default 1.0)

threshold up to which changes in left-indent are ignored (in points, default 75)

directory containing the configuration files

text in this font is sent through without any translation (default Tekton)


various configuration files and scripts


rtftohtml.1, the rmhtml.1 manpage, the rmrtfd.1 manpage, the compress_gifs.1 manpage


Elmar Ludwig < feludwig@informatik.Uni-Osnabrueck.DE >