The Man Page

Synopsis

rtf2xml [ --help ]

rtf2xml [ --version ]

rtf2xml [ --config ]

rtf2xml [ --no-caps ] [ --caps ] [ --no-caps ] [ --no-lists ] [ --lists ] [ --empty-para ] [ --no-empty-para ] [ --headings-to-sections ] [ --no-headings-to-sections ] [ --group-styles ] [ --no-group-styles ] [ --group-borders ] [ --no-group-borders ] [ --level number ] [ --indent number ] [ -o, --output out-file ] path

Description

The script rtf2xml converts Microsoft's proprietary rich text format (RTF) to XML. It preserves as much information from the RTF files as possible, giving an XML author the choice of what elements to use for further transformations.

Unless the <smart-output> is specified in the configuration file, or the --output option is used, rtf2xml outputs to the terminal. If the RTF file contains any graphic information, a directory will be created with this information. The directory will take the same name as the RTF file, appending and "_rtf_pict_dir" at the end. (For example, If the original file "my_file.rtf" contained graphic information, a directory named "my_file_rtf_pict_dir" will be created.) If this directory already exists, its contents will be emptied before the script performs the transformation. The directory will reside in the same directory as the transformed file.

Options

--help

Print a help message and quit.

--version

Print out the version and quit.

--config

Print out the path to the configuation file and quit.

-o, --output file

The file to output to.

Example:

rtf2xml --output my_file.xml my_file.rtf

The file "my_file.xml" will be created. If the file "my_file.rtf" contains graphic information, a directory called "my_file_rtf_pict_dir" will be created in the same directory as the file.

--caps

Change characters tagged as captials to their capital equivlents. Since the script automatically performs this transformation, you don't need to use this option unless you have set the configuration script to not have captials transformed, and you want to override what the configuration file says.

RTF stores certain characters in an odd way. For example, if you type the word "title" and then choose the format "all caps" from the menu, the word is actually stored as "title", instead of "TITLE."

The script rtf2xml seeks to correct this mistake by changing all lower-case characters within the element "caps" to upper-case.

Use this option to make sure the script changes lower-case to upper-case.

--no-caps

Don't change characters tagged as captials to their capital equivlents. Setting this option has the opposite effect as using the --caps option.

If you wish to suppress the scripts ability to change lower-case to upper-case, use this option

--level number

Run the script at level <number>.

At this point, a user should choose "1" (the default, unless otherwise specified in the configuration file), or "3". A level 1 indicates a normal run. Level 3 indicates a debug run. A debug directory will be created, and more error messages will be outputted.

--indent number

At this point, the --indent option only controls whether the final XML get output as one long line, or in the more readable form of blocks.

For strict XML, in which you don't want any extraneous white space, use "0" as your number.

Otherwise, use any number above zero.

--no-lists

Whether to give structure to lists.

An RTF document does not give any structure to lists. Instead, it tags each item with a number.

By default, rtf2xml gives the RTF numbering scheme a list-structure.

If you do not wish to have this structure in your document, use the --no-lists option.

--lists

Form lists from the RTF file.

--empty-para

Write empty paragraphs.

--no-empty-para

Do not write empty paragraphs.

--group-borders

Provide a wrapper element <group-borders> for borders.

--no-group-borders

Do not provide a wrapper element <group-borders> for borders.

--group-styles

Provide a wrapper element <group-styles> for paragraphs with the same name.

--no-group-styles

Do not provide a wrapper element for paragraphs with the same name.

--headings-to-sections

Convert styles with heading names (such as "heading 1") to sections.

--no-headings-to-sections

Do not convert styles with heading names (such as "heading 1") to sections.