1 / 21

Anatomy of an RTF File

Anatomy of an RTF File. George Tisdale April 30, 2005. Basic Components. Lead in Font table Color table Style sheet Information Data. Lead In. Identifies the file as an RTF file Sets the default language. Font Table. Lists the fonts that are used

borka
Télécharger la présentation

Anatomy of an RTF File

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Anatomy of an RTF File George Tisdale April 30, 2005

  2. Basic Components • Lead in • Font table • Color table • Style sheet • Information • Data

  3. Lead In • Identifies the file as an RTF file • Sets the default language

  4. Font Table • Lists the fonts that are used • Equates the fonts with an f# reference Example: f0 is Times New Roman in the previous slides

  5. Color Table • List of colors as a mix of red, green and blue • Each item is separated by a semi-colon • If an item is missing the default is used, but the semi-colon must be present

  6. Style Sheet • Mixes fonts, typeface sizes, boldness, indents, tabs and colors into a Style number • Styles are “\s##” two digit number usually starting at 11 • Numbers are set at 1440=1 inch • Tab stops are defined \tqc\tx2160 sets a centering tab at 1.5 inches

  7. RTF Document RTF reader (Word) has interpreted the file and translated it into a formatted document.

  8. LIBRTF.DLL • Prepares the skeleton of the file • Converts simple annotations into RTF code • Replaces imbedded instructions with RTF code • Processes an RTF file from a passed matrix of data

  9. Syntax • FNRTF( • MAT TYPES$, • MAT STYLES$, • MAT DATA$, • RTFFILE; • LMARGIN, • RMARGIN) (LMARGIN and RMARGIN are optional)

  10. TYPES$ • Matrix of single character codes • H – header • F – footer • D – data • T – Total These are examples and not required usage

  11. Styles • Matrix of same size as TYPES$ that defines the styles being used • Elements separated by pipes “|” STYLES$(1)="li0|ri0|fs18|cfBlue|tc3.25|Header" STYLES$(3)="li0.25|ri0|fs10||tl2.5|td3|tl3.2|td4.0|tl4.2|td4.6|tl4.8|td5.4|Data"

  12. DATA$ • Text to be printed by RTF reader • Fields separated by pipes “|” • Pipes represent TAB characters • Additional tabs embedded with “\tab “ • Grouped with “{“ and “}” LET DATA$(1)="H|\b\tab Title Of Report"

  13. RTFFILE • Existing open display file • Open with • recl=32000 • EOL=none

  14. Margins • RTF reader will use its default margins • Overrides can be set for WORD using • LMARGIN • RMARGIN

More Related