Alan Freedman's The Computer Desktop Encyclopedia says RTF is "A Microsoft
standard for encoding formatted text and graphics. It was adapted from IBM's DCA
format ....". Document Content Architecture (DCA) was developed by IBM as an early
word processor format for text documents. Microsoft presently uses RTF as the
internal markup language for Word, and most other word processing and DTP
applications have a filter for writing to and reading RTF.
Looking at an RTF file with a text editor is likely to leave an impression of utter chaos. Windows-based applications that can generate RTF often use large amounts of redundant code. I am not suggesting that anyone should set out to hand code a file in RTF. However, an RTF file can be manipulated with programs, such as Perl, to extract data and Metadata, convert RTF to HTML, change the format of a document, apply Unicode, and tag sections of text in a particular language for spell checking-for example, some German text in a predominantly English-language document. It is possible to change an RTF document's specified paper size (for example, from American letter to A4), orientation (landscape/portrait), and margins; that, and other handy information (such as line drawing) is included in a tutorial section of RTF Pocket Guide. Microsoft offers a Help Compiler (hc.exe) for the creation of help files, but an understanding of RTF is necessary to apply the special dialect used by the compiler. Microsoft has a specification at http://www.msdn.microsoft.com/library/en-us/dnrtfspec/html/rtfspec.asp and support.microsoft.com (using access number 269575), but it's not an easy read. Conversion tools are available http://www.logictran.com, and http://www.omnimark.com are worth looking at), but there is not much literature beyond MS's terse specification. The only RTF-specific text I have seen is O'Reilly's RTF Pocket Guide. It carries a sub-title The Universal Document Format, but I am not sure that is a deserved description of RTF; PostScript has-in my opinion-a better claim to universality. It depends on what is meant by 'universal': widely implemented in software, widely used, or universally accessible? The fact that RTF is widely implemented doesn't mean that its use is universal. Like SGML/XML/HTML, PostScript, and TeX, an RTF source file is written in ASCII and will still be accessible even when Microsoft has gone out of business. The Pocket Guide contains an exceptionally well-presented description of RTF and includes a tutorial on how to use it. The publisher makes it clear that this is not a definitive reference; even so, it is probably the most meaningful text on the subject: relevant, comprehensible, practical, and supported by useful examples. The focus is on the essentials, but with this as a guide the official specification will be a lot easier to understand. It is in four parts. Part 1 is the tutorial and discusses syntax, how paragraphs are created, document structure, character formatting, style sheets, and tables. The tutorial takes up about have of the book. Part 2 deals with creating MS Windows help files, which is an important topic for developers or other who are involved in 'help' documentation. Embedding images is amongst the topics discussed. Part 3 contains example programs using simple Perl scripts. One of the programs (fully listed with explanations) is an Origami CD case maker, which "generates a single page that, when folded correctly, makes a CD case". It illustrates two features: exact paragraph placement and line drawing. Another example program is an RTF Metadata extractor that show how a digital library of science journal articles can be created from material in RTF. Part 4 contains useful tabulated data. If you have a sense of enquiry-even if you don't see yourself with a need to parse RTF documents-this is an interesting insight into the Rich Text Format. It is not just a catalogue of commands and tokens; the author explains what they do and how they are applied. The language is remarkably clear in this very readable account of what many would consider an arcane topic. And it is inexpensive.
Reprinted from the October 2003 issue of PC Update, the magazine of Melbourne PC User Group, Australia
|