WordPerfect 4.1 File Format A WordPerfect 4.1 file has no header or footer. There are two types of codes: Codes between 80h and BFh are single-byte codes. Codes between C0h and FFh are multi-byte codes, which are usually terminated with a repetition of the code byte. The following codes are significant for WordPerfect 4.1 files: WordPerfect 4.1 Single-Byte Codes Code Meaning 09 Tab 0A Hard newline 0B Soft new page 0C Hard new page 0D Soft newline 80 No-op (always deleted) 81 Right justification on 82 Right justification off 83 End of centred text (see C3) 84 End of aligned/flushed text (see C4) 85 Temporary starting point for math calculations 86 Centre page from top to bottom 87 Begin column mode 88 End column mode 89 Tab after the right margin 8A Widow/Orphan control on 8B Widow/Orphan control off 8C Hard end of line and soft end of page 8D Footnote number (appears only inside of footnotes) 8E, 8F Reserved 90 Red line on 91 Red line off 92 Strikeout on 93 Strikeout off 94 Underline on 95 Underline off 96 Reverse video on (reserved) 97 Reverse video off (reserved) 98 Table of contents placeholder 99 Overstrike 9A Cancel hyphenation of following word 9B End of generated text 9C Bold off 9D Bold on 9E Hyphenation off 9F Hyphenation on A0 Hard space A1 Do subtotal A2 Subtotal entry A3 Do total A4 Total entry A5 Do grand total A6 Math calculation column A7 Begin math mode A8 End math mode A9 Hard hyphen in line AA Hard hyphen at end of line AB Hard hyphen at end of page AC Soft hyphen AD Soft hyphen at end of line AE Soft hyphen at end of page AF End of text columns and end of line B0 End of text columns and end of page BC Superscript BD Subscript BE Advance printer 1/2 line up BF Advance printer 1/2 line down WordPerfect 4.1 Multi-Byte Codes Code Length Meaning and format C0 6 Margin Reset C1 4 Spacing Reset (uses half-line values) C2 3 Left Margin Release <# of spaces to go left> C3 5 Centre following text type: 0 - centre between margins, 1 - centre around current column End centred text by using code <83>. C4 5 Align or flush right If align char = \n, this is a flush right command and the align col # is the right margin; otherwise, the align col # is the next tab stop. If the high bit of the align char is set, then this is a dot leader align or dot leader flush right. End aligned or flushed text by using code <84>. C5 6 Reset hyphenation zone C6 4 Set page # position Code: 0 - none, 1 - top L, 2 - top centre, 3 - top R, 4 - top L&R, 5 - bottom L, 6 - bottom centre, 7 - bottom R, 8 - bottom L&R C7 6 Set page number These are two fifteen-bit numbers. Setting the high order bit selects Roman numerals; otherwise Arabic numbers are used. C8 8 Set page number colunn positions C9 42 Set tabs CA 3 Conditional end of page <# of lines not to be broken> CB 6 Set pitch/font Setting pitch to a negative value selects a proportional font. CC 4 Set temporary margin CD 3 End of temporary margin (No longer used) CE 4 Set top margin CF 3 Suppress page characteristics Code bits: 1 - all suppressed, 2 - page numbers suppressed, 4 - page numbers moved to bottom, 8 - all headers suppressed, 16/32 - header a/b suppressed, 64/128 - footer a/b suppressed D0 6 Set form length D1 var Header/footer <# half lines used by old header/footer> <# half lines used by new header/footer> Def Byte contents are type (two low-order bits) and occurrence (six high bits). The low-order 2 bits of the Def byte must be correct. Type: 0 - header a, 1 - header b, 2 - footer a, 3 - footer b Occurrence: 0 - never, 1 - all pages, 2 - odd pages, 4 - even pages D2 var Footnote <# half lines> (Not used in version 4.0 and above; see E4) D3 4 Set footnote number (Not used in version 4.0 and above; see E4) D4 4 Advance to half line # D5 4 Set 6/8 lines per inch D6 6 Set extended tabs D7 var Define math columns []<0>[] <0>[]<0>[]<0> []<0>[]<0>[]<0> []<0> For the column definition, see DD. D8 4 Set alignment character D9 4 Set left margin release (Not used in version 4.0 and above) DA 4 Set underline mode 0 - single, broken 1 - double, broken 2 - single, continuous 3 - double, continuous DB 4 Sheet feeder bin number DC var End of page function <# of half lines at end of page h> <# of half lines used for footnotes> <# of pages used for footnotes><# footnotes on this page> If end of page is for the last column on the page, then after the suppress code and before the final function code there are five more bytes: <# of half lines for column 1-4> DD 24 Define columns
high order bit of # cols is 1 for parallel columns DE 4 End of temporary margin DF var Invisible characters If a character has an ASCII code >= 6F, it is represented as <6F> E0 4 Left/Right temporary margin <0> Pre-4.0 format: E1 3 Extended Character E2 var New Footnote/Endnote <# lines page 1> <# lines page 2><# lines page n><# pages> def: bit 0: 0 - numbers, 1 - characters 1: 0 -footnote, 1 - endnote a, b:If numbers, a&b are a 14-bit number. If letters, a = # of characters, b = a character c, d:14-bit number representing # of lines in note. For endnotes, there is only a null between and . E3 150 Footnote information (options) function Bytes: 1 - spacing in footnotes, 2 - spacing between footnotes, 3 - # of lines to keep together, 4 - flag (b ln en ft n) n - 1 if numbering starts on pg, en, ft: 0 - #'s, 1 - chars, 2 - letters ln: 0 - no line separator, 1 - 2" line, 2 - line btw margins b: 0 - footnotes after text, 1 - footnotes at bottom of page 5 - # of characters used in place of footnote #'s 6-10: "numbering" characters 11-74: four strings, alternating btw footnotes and endnotes Byte 1 - Length, Bytes 2-16 - String E4 6 New set footnote number The numbers are two 14-bit numbers. E5 23 Paragraph number definition Def Byte: Low nibble: 0/1 - upper/lower case Roman, 2/3 - upper/lower case letter, 4 - Arabic, 5 - Arabic with previous levels separated by '.' High nibble: 0 - no punctuation, 1 - '.' after, 2 - ')' after, 3 - '(' before, ')' after E6 11 Paragraph number E7 3 Begin marked text def (high nibble) 0 - toc, 2 - list info:level(0-6)/list #(0-4) E8 3 End marked text (ends an E7) E9 8 Define marked text <5 byte definition> For tocs, the bytes represent five levels else the first definition byte is significant. Definition bytes: 0 - no page #'s , 1 - page # after text (preceded by two spaces), 2 - page # after text (in parens), 3 - page # flush right, 4 - page # flush right w/dot leader EA var Define index mark <30 byte, null-terminated string> EB 32 Date/Time function <30 byte null-terminated fmt string> EC 4 Block protect <# of half-lines in block>