RTF is like many other formats, in that when you want to output in that format, you can stick to whatever syntactic and semantic subset of the language is most convenient for you. This book does not discuss the task of parsing RTF documents. In addition, since RTF files are text files, it’s easy to produce RTF with a program in any programming language, whether it’s Perl, Java, C++, Pascal, COBOL, Lisp, or anything in between. You can produce RTF without any knowledge of the font metrics needed for Adobe PostScript or PDF. RTF now supports Unicode, so it can represent text in just about every human language ever written. In RTF, font size and style, paragraph indenting, page breaks, page numbering, page headers and footers, widow-and-orphan control, and dozens of other features are each a single, simple command. In HTML, if you want to control the size and style of text or the positioning and justification of paragraphs, the best you can do is try a long detour through CSS, a standard that is erratically implemented even today. In RTF, format control is straightforward.
#RICH TEXT FILE WINDOWS#
That is, if you email an RTF file to a dozen people you know, chances are that almost all of them can read it with a word processor already on their system, whether it’s MSWord, some other word processor (ABIWord, StarOffice, TextEdit), or just the RTF-literate write.exe that has been part of MSWindows since at least Windows 98.
#RICH TEXT FILE SOFTWARE#
Most people have the software to read RTF.
#RICH TEXT FILE MAC OS X#
Moreover, RTF is the data format for “rich text controls” in MSWindows APIs RTF-rendering APIs are part of the Carbon/Cocoa APIs in Mac OS X and you can even read RTF documents on iPods, Apple’s portable music players. While not every word processor understands every RTF feature perfectly, most of them understand the RTF commands discussed in this book quite well. Since RTF has been around for so long, just about every word processor since the late 1980s can understand it.
That means if you generate an RTF file today, you should be able to read it in 10 years, and you should have no trouble reading an RTF file generated 10 years ago. In fact, while there has been a proliferation of incompatible binary formats calling themselves “Microsoft Word file format,” RTF has stayed the course and evolved along backward-compatible lines. RTF’s syntax is stable and straightforward, and its specification has existed for over a decade-an eternity in computer years. Microsoft doesn’t distribute copies of them anymore, but you can find them all over the Internet by running a search on “Rich Text Format (RTF) Specification” in Google or a similar search engine. Version 1.5 of the specification and before are more verbose, and might be more useful. In the Microsoft Knowledgebase at, its access number is 269575.
The current version (v1.7) is available at. This book is not a complete reference to every last feature of RTF Microsoft’s comprehensive but terse Rich Text Format (RTF) Specification is the closest you will find to that. The flexibility of RTF makes it an ideal format for everything from generating invoices or sales reports, to producing dictionaries based on databases of words. For example, if you even just skim this book, you should be able to write a program (in the programming language of your choice) that can analyze the contents of a database and produce a summary of it as an RTF document with whatever kinds of formatting you want. Instead, it’s meant to be a format for document data that all sorts of programs can read and write. RTF is not intended to be a markup language anyone would use for coding entire documents by hand (although it has been done!). This book is also a useful introduction to parsing RTF, although that is a more complex task. It covers the essentials of RTF, especially the parts that you need to know if you’re writing a program to generate RTF files. This book is a convenient reference for Rich Text Format (RTF).