WordPerfect 5.1 Document Format

This section describes the WordPerfect file format for WordPerfect 5.0 (WP5.0 DOS, UNIX, Data General, VAX), WordPerfect 5.1 (WP5.1DOS, UNIX, VAX), and WordPerfect 5.1/5.2 for Windows (WPWin5.1/5.2) documents.

Note:WP5.1 (without an extension) refers collectively to WP5.1DOS, WP5.1VAX, WP5.1 UNIX, and WPWin5.1/5.2.

WordPerfect documents are binary files that contain both ASCII characters and special formatting codes. Each document has two major sections: a prefix area and a document area.

The prefix area contains:

Information that identifies the file as a WP5.1/5.0 document

Default values for margins, fonts, and other format settings

Information about the selected printer

Graphic images contained in the document

The document area contains the actual text and formatting codes that make up the bulk of the file.

Sizes are referred to as bytes, short (for short integers), or long (for long integers). Depending on the environment and operating system you are working on, these can be translated using the information in the following table.

Table WPF.1: Size Definitions

Byte

character (char)

byte

8 bits

Short

integer

word

16 bits

Long

long integer

double word

32 bits

All Wordperfect document files follow the Intel "byte reversed" method of storing short and long integer values. In this storage method the high byte of a short integer comes first, and the high short integer comes first in a long integer value. The following two block diagrams represent this storage format.

<---------------------- short integer ------------------------>

[low byte]

[high byte]

(high nibble)

(low nibble)

(high nibble)

(low nibble)

Bit #

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

<--------------------------------------- long integer ---------------------------------------->

[low short integer]

[high short integer]

(low byte)

(high byte)

(low byte)

(high byte)

31

30

29

28

27

26

25

24

23

22

21

20

19

18

17

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Decimal numbers larger than 9 are followed, in parentheses ( ), by a number that begins with 0x. This represents the equivalent value in the hexadecimal number system. Singledigit decimal numbers stand alone, because such numbers have the same value in either hexadecimal or decimal. In most cases values are unsigned. An example of how unsigned values are documented is 255 (0xFF). An example of how signed values are documented is 1 (0xFF).

Measurements and positions can be stored in one of two units:

wpu = WordPerfect units (1 = 1/1200th of an inch, or 0.02117 mm)

su= Screen pitch units (1 = 1 screen display column)

The file format for the WP4.2 version contains only a document body with function codes. WP4.2 files do not have a prefix header. The WP42FF.TXT file on the Toolkit diskette (PC Developer's Toolkit only) contains the function codes for WP4.2.WordPerfect Prefix Area

Prefix Area

The prefix area of a WP5.1 document consists of a 16byte file prefix followed by additional prefix information that is specific to the document. This can be any length, depending on the WordPerfect document and file prefix contents.

File Prefix

All files created by WPCorp products begin with a 16byte file prefix that identifies the file type, product, and version.

The file prefix has the following structure:

FieldSizeValue for WP5.1 Document

WPCorp File ID4 bytes1 (0xFF),WPC

Start of DocumentlongFile position of start of document

Product Type1 byte1

File Type1 byte10 (0xA)

Major Version #1 byte0

Minor Version #1 byte0 in WP5.0, 1 in WP5.1

Encryption Keyshort0 = not encrypted

Reservedshort0

The following diagram illustrates the prefix area structure of a WP5.0, WP5.1,and WPWin5.1 document. The shaded section of the diagram is the 16byte file prefix that identifies a WPCorp file. The definitions of the 16byte length are in byte, short, or long lengths.

1

W

P

C

Pointer to Document Area

Prd

File

MjV

Mnv

Encrypt

Reserved

65531 (0xFFFB)

# Indexes

Indx Bk Size

Pointer to Next Block

Packet Type

Length

Pointer to Data 1

Packet Type

Length

Ptr to Data 2

. . .

. . .

Data 1 Data 1 Data 1 Data 1 Data 1

Data 2 Data 2

Data 2 Data 2 Data 2

. . .

Prefix continued

Document Area

WPCorp File ID

The WPCorp File ID fields are the first four bytes of a file and have the same values for all files produced by WPCorp products (excluding WP4.2). It is displayed as 1WPC or FF 57 50 43 in hexadecimal value. If you look at a WPCorp file in any binary program editor or ASCII editor, this ID ought to be there. If you do not see this ID, the file is not a WPCorp 5.x file.

Start of Document

The Start of Document field is a long value that begins at offset 4 in the 16byte file prefix heading. This is a pointer to the beginning of the document area. Short integers and long integers are saved in a bytereversed order.

Please note that if you place any codes such as margins, tabs, font changes, or a specific page size at the beginning of your document, those codes appear before the actual text begins.

Product Type Field

The Product Type field is one byte in length and is the ninth byte from the beginning of the file. It contains a value that identifies the WPCorp software product used to create the file. The field type can have one of the following values:

ValueProduct

1WordPerfect

2Shell

3Notebook

4Calculator

5File Manager

6Calendar

7Program Editor/Ed Editor

8Macro Editor

9PlanPerfect

10 (0xA)DataPerfect

11 (0xB)Mail

12 (0xC)Printer (PTR.EXE)

13 (0xD)Scheduler

14 (0xE)WordPerfect Office

15 (0xF)DrawPerfect

16 (0x10)LetterPerfect

Please remember that other product type values may be added in the future.

File Type Field

The File Type field is one byte in length and is the tenth byte from the beginning of the file. The value depends on the Product Type (WPCorp software product) used to create the file. The first ten values (09) are reserved for general purpose files that have application across all WPCorp products. The values 10 and above are available for productspecific file types and are listed below in the WordPerfect File Types subsection.

General Purpose File Types

These general purpose file types are documented for your information only. These files types are specified for the use of WPCorp software.

ValueFile

1Macro file

2Help file

3Keyboard definition file

4VAX keyboard definition file added for WP5.1 (33090)

Note:The Help file does not have a prefix, but the 2 value is still reserved for the help file. Any thirdparty software or application can thus disregard the help file types.

WordPerfect File Types

The file type for WPCorp products is one byte in length and identifies what type of file it is. The values are 16 (0x10) and above, and the file may not specifically be a document file.

The following file types are specific to WP5.0 and are also used for WP5.1.

The following file types are specific to WPCorp:

ValueFile

10 (0xA)WordPerfect document

11 (0xB)Dictionary file

12 (0xC)Thesaurus file

13 (0xD)Block

14 (0xE)Rectangular block

15 (0xF)Column block

16 (0x10)Printer resource file (.PRS)

17 (0x11)Setup file (contains the system values for WP{WP}.SET [Setup values, ShiftF1])

18 (0x12Reserved

19 (0x13)Printer resource file (.ALL)

20 (0x14)Display resource file (.DRS)

21 (0x15)Overlay file (WP.FIL)

22 (0x16)WP graphic file (.WPG)

23 (0x17)Hyphenation code module

24 (0x18)Hyphenation data module

25 (0x19)Macro resource file (.MRS)

26 (0x1A)WP5.0 Graphics/Text Drivers

27 (0x1B)Hyphenation lex module

The following file types were added to the WordPerfect file type for WP5.1:

ValueFile

28 (0x1C)Printer Q codes (used by VAX/DG)

29 (0x1D)Spell code moduleword list

30 (0x1E)WP.QRS file (WP5.1 equation resource file)

31 (0x1F)Reserved

32 (0x20)VAX .SET

33 (0x21)Spell code modulerules

34 (0x22)Dictionaryrules

35 (0x23)Reserved

36 (0x24)WP5.1 Graphics/Text Drivers

37 (0x25)Rhymer word file (WPCorp product, TSR)

38 (0x26)Rhymer pronunciation file

39 40 (0x27 0x28)Reserved

41 (0x29)WP51.INS file (install options file)

ValueFile42 (0x2A)Mouse driver for WP5.1

43 (0x2B)UNIX Setup file for WP5.0

44 (0x2C)MAC WP2.0 document

45 (0x2D)VAX file (WP4.2 document)

46 (0x2E)External Spell Code Module (WP5.1)

(This file type is set aside for third parties to create their own speller code modules in WP5.1 DOS)

47 (0x2F)External Spell Dictionary

(This file type is set aside for third parties to create their own dictionary .LEX files to be read by their speller code.)

48 (0x30)MAC SOFT graphics file

(SOFT(Sequential Object FormaT) graphics file for the MAC WP)

49 50 (0x31 0x37)Reserved

51 (0x38)WPWin5.1 Application Resource Library added for WPWin5.1

Major and Minor Version Field

The Major and Minor Version fields are each one byte in length. The value in the fields indicates the version number that the file type was created for. The value may or may not correspond to the product's published revision number. The Major version number for WordPerfect 5.x files is 0.

Note:The Minor Version # for WP5.0 is 0. The Minor Version # was incremented for WordPerfect 5.1 (the value is 1). The Minor Version # for WPWin5.1/5.2 is 1, the same number used for WP5.1.

Encryption Key Field

The Encryption Key field is a shortinteger value and occupies the 13th and 14th bytes. It must be a value 0 if the file is not encrypted; otherwise, it must contain a hash value of the password. This hash value is used as a checksum to see if the user typed the correct password.

Reserved Field Type

Do not use the Reserved field. It must be zero (0).

Additional Prefix Area

The additional prefix area follows the 16byte file prefix. Its structure depends on the product and file type. The additional prefix information for WP5.0 and WP5.1documents is organized into index blocks and data packets. Each index block contains several indexes that point to data packets. The first index in each block is a special header index that gives the number of indexes in the block. It also gives the pointer to the next block. There can be more than one block (five indexes) in a prefix header, depending on how much information is stored in the prefix.

WP5.0 and WP5.1currently store five, and only five, indexes in each index block (the special header index plus four general purpose indexes).

Each index block in a WP5.0/5.1 and WPWin5.1/5.2 file consists of a special header index followed by four indexes that point to data packets. The data packets immediately follow the index block. The prefix area of the file consists of a sequence of index blocks and associated data chained together by the special header index in each index block.

Special Header Index

The special header index is 10 bytes long. It has the following structure (also illustrated in the shaded area of the diagram):

OffsetSizeUsage

0shortPacket type for header index 65531 (0xFFFB)

2short# of indexes (including the special header, there are five in WP5.0 and WP5.1 documents.)

4shortSize of index block 50 (0x32) (# of indexes * 10)

6longFile position of next index block from beginning of file

1

W

P

C

Pointer to Document Area

Prd

File

MjV

Mnv

Encrypt

Reserved

65531 (0xFFFB)

# Indexes

Indx Bk Size

Pointer to Next Block

Packet Type

Length

Pointer to Data 1

Packet Type

Length

Ptr to Data 2

. . .

. . .

Data 1 Data 1 Data 1 Data 1 Data 1

Data 2 Data 2

Data 2 Data 2 Data 2

. . .

Prefix continued

Document Area

General Packet Types

The general packet types indexes in the index block are also 10 bytes long. They have the following structure and are illustrated in the diagram below:

OffsetSizeUsage

0shortPacket type

2longLength of data packet

6longFile position of data for packet type

1

W

P

C

Pointer to Document Area

Prd

File

MjV

Mnv

Encrypt

Reserved

65531 (0xFFFB)

# Indexes

Indx Bk Size

Pointer to Next Block

Packet Type

Length

Pointer to Data 1

Packet Type

Length

Ptr to Data 2

. . .

. . .

Data 1 Data 1 Data 1 Data 1 Data 1

Data 2 Data 2

Data 2 Data 2 Data 2

. . .

Prefix continued

Document Area

Special Data Packet Types

The following special data packet types are defined for use by all file types:

ValuePacket Type

0End of prefix

65531 (0xFFFB)Header index for index block

65532 (0xFFFC)Reserved

65533 (0xFFFD)Reserved

65534 (0xFFFE)Reserved

65535 (0xFFFF)Deleted packet (may still exist in file)

Notes:The WP5.1 document prefix has the same structure as it does in WP5.0. However, some data packets have different values in WP5.1 and add new packet types for WP5.1 additional features. Note the following changes listed under packet types. WP5.0 and WP5.1 are forward and reverse compatible. When retrieved into WP5.0, additional features of WP5.1 are recognized as [UNKNOWN] codes. When the document is again retrieved into WP5.1, the [UNKNOWN] codes are recognized as their original features.

If Fast Save is not active in WordPerfect 5.1, the file prefix is purged of deleted packets (65535 [0xFFFF]) when the file is saved. If Fast Save is active, deleted packets can still exist in the file prefix after the file is saved.

WordPerfect Packet Types

The following are data packet types defined for WP5.0/5.1, and WPWin5.1/5.2 documents that are found in the additional prefix area. They are used or referred to in the general packet types structure.

ValuePacket Type

1Document summary packet

2List of fonts used in document (WP5.0)

3Document initial codes

4Reserved

5Reserved

6Document specific flags

7Font name string pool

8Graphics information

9Form hash table

10 (0xA)Reserved

11 (0xB)Reserved

12 (0xC)Document printer (.PRS file name, etc.)

13 (0xD)Reserved

14 (0xE)Supplemental dictionary compressed words

15 (0xF)List of fonts used in document (WP5.1)

16 (0x10)DDE link packet added for WPWin5.1 (In UNIX 5.1 only, this packet # indicates the # of pages)

17 (0x11)Macro executable code added for WPWin5.1

18 (0x12)Reserved

19 (0x13)Macro information block added for WPWin5.1

20 (0x14)Reserved

21 (0x15)OLE prefix added for WPWIN 5.2

256 (0x100)First style packet # (use 256 packets for styles)

511 (0x1FF)Last style packet # (use 256 packets for styles)

512 (0x200)PS table packet first packet

767 (0x2FF)PS table packet last packet

WP Packet Type Structure for Packets 1 767 (1 0x2FF)

The following are the related structures to the WordPerfect document prefix packet types:

Packet Type 1 Document Summary Packet

Except for the fields marked and the last 3 fields in the WP5.1 format, all fields are null terminated strings.

If a user imports a 5.0 document file into the 11/6/89 release of WP5.1, and the file had a summary packet in it, the following could happen: If the user never edited the summary information, this version of 5.1 would not rewrite the 5.0 summary packet. A document saved out of this version of 5.1, labeled as being a 5.1 document, but has a 5.0 formatted summary packet. Keep this in mind if your program is reading WP5.1 files.

FieldWP5.1 Max LenWP5.0 Max Len

Creation date (string form)26 (w/null)26 (w/null)

Descriptive name68 (no null)41 (w/null)

Descriptive type21 (w/null)N/A

Lengths are padded with spaces to be exact, so that a document management program can change the name or type without completely rewriting the prefix packet.

Subject16140

Author6140

Typist6140Abstract (comments in WP5.0)781780

End of WP5.0 Document Summary

Account161N/A

Key words161N/A

WP5.1 Format Marker 1N/A (always equals 1 [FFh])

Creation date (10byte format)10N/A

WP5.1 Format Marker 1N/A (always equals 1 [FFh])

Note:"WP5.1 Format Markers" are used by WP to determine whether the summary packet is in the format used by WP5.0 (the markers don't exist) or the expanded format of WP5.1. If the end of the packet data has the value 0FFh (1), then it is a WP5.1 format. If the packet ends with zero, then it is a WP5.0 packet.

Packet Type 1 and the 10byte Creation Date format for the Document Summary Packet is as follows:

OffsetSizeMeaning

0shortYear

21 byteMonth

31 byteDay

41 byteHour

51 byteMinute

The next four bytes are unused (0) in the Document Summary Packet, but are:

61 byteSecond

71 byteDay_of_week

81 byteTime_zone

91 byteUnused

Packet Type 2 List of Fonts Used in Document (WP5.0)

This packet is a variablelength list of records. To determine the number of these records, divide the size of the packet by the size of the record structure below. The structure of these records is as follows:

OffsetSizeUsage

0shortFont ID (instance pointer)

2shortCache ID of PS table (0xFF [1] = no PS table)

4shortTop shoulder height (psu)

6shortBottom shoulder height (psu)

8shortPrinted char width (wpu)

10shortDesired space width (wpu)

12shortNormal space width (wpu)

14shortHorizontal motion units

16shortNumerator for fractional units of horizontal motion

18shortPointer into font string pool of font names

201 byteFlags

211 byteAvailable (to ensure short integer alignment)

22shortPrinter point size in 3600ths (same as offset 26 if not scalable)

24shortHash

2624 bytesOffsets 0 20 of Font Descriptor (See Packet 15 [0xF] for format)

5016 bytesAFC (Automatic Font Changes) list (attribute list)

6616 bytesCharacter AFC list

824 bytesOrientation AFC list

Packet Type 3 Document Initial Codes

This variablelength packet contains function codes as they appear inside a document. Setup Initial Codes inserts the function codes originally, but you can modify them separately. They keep the system's setup environment and the document together when both are moved to a different environment.

Packet Type 4 Reserved (not used)

Packet Type 5 Reserved (not used)

Packet Type 6 DocumentSpecific Flags and Information

This packet contains information about the document itself at the time it was saved. The format of Packet Type 6 is as follows:

OffsetSizeUsage

01 byteFlag bits for document

bit 0:

0 = WPWIN Wysiwyg manual display pitch

1 = WPWIN Wysiwyg auto display pitch

bits 1 & 2:

0 = font change

1 = red color

2 = char in left margin

3 = char in alternating margins

bit 3 = 1 if document must be formatted

bit 4 = 1 if document must be (re)generated

bit 5 = 1 if manual display pitch

bit 6 = 1 if links must be updated on retrieval

bit 7 = 1 if links codes are not to be displayed

11 byteLow nibble = print quality

High nibble = graphics quality

For each nibble:

0 = don't print

1 = draft

2 = med

3 = high

2shortRedline character

4shortWidth of screen character

6shortBinding width of document

81 bytePrinter select cnt flag for eqn hash

91 byte Reserved

10shortDocument display pitch. 0x100 = 100%

12shortScreen resolution

14shortReserved

Packet Type 7 Font Name String Pool

This variablelength packet contains the font names in the font list. The font list records each have a field that points to an offset in this packet that indicates its font name. These are nullterminated, font-name strings.

Packet Type 8 Graphics Information

Give special handling to the graphics image data (Packet Type 8). The index for this data packet must be the last index in the prefix area (except for an End of Prefix index). The value of the long integer length given in the index is 2. The graphic image data has the following structure:

OffsetSizeUsage

0shortCount of # of graphic images

2longSize of first graphic image

6longSize of second graphic image

10longSize of third graphic image

......

......

(# graphics * 4)+2variableData for first graphic image (see the DrawPerfect section of this manual for .WPG file formats)

+ size 1variableData for second graphic image

+ size 2variableData for third graphic image

......

......

......

Packet Type 9 Forms Hash Table

This variablelength packet is a list of hash values (short integers). The hash values correspond to each form that the user defined. To determine the number of forms hashed, divide the packet size by 2.

Packet Type 10 (0xA) Reserved

Packet Type 11 (0xB) Reserved

Packet Type 12 (0xC) Document Printer (.PRS file, etc.)

This fixedsize packet contains information about the selected printer. The structure is as follows:

OffsetSizeDescription

037 bytesLong name of .PRS file

3713 bytesActual .PRS filename

5024 bytesDescriptor for initial font

74shortMinimum top margin

76shortMinimum bottom margin

78shortMinimum left margin

80shortMinimum right margin

821 byteFlags

bit 0 = used by printer selection to mark selected printer

bit 1 = initialize printer when WP starts

bit 3 = right hzone disabled

bits 4,5,6,7 = orientations supported

83short Date of .PRS file

bits 04 = day (starting at 1)

bits 58 = month

bits 915 = year+80

85shortTime of .PRS file

bits 04 = seconds/2 (may not be too accurate)

bits 510 = minutes

bits 1115 = hour (24 hour starting at 0)

87shortPoint size of current font

891 byteTypeface flags

Packet Type 13 (0xD) Reserved

Packet Type 14 (0xE) Supplemental Dictionary Compressed Words

Packet Type 15 (0xF) List of Fonts Used in Document (WP5.1)

Structure of Prefix Font Information

The following 86byte structure is repeated for each font in a document:

Where in

OffsetSizeDescription.PRS File

0shortFont ID (instance pointer)Font def

2shortCache ID of PS table (1 [0xFF] = no PS table)Font def

4shortTop shoulder height (psu)

6shortBottom shoulder height (psu)

8shortPrinted char width (wpu)

10shortOptimal space width (wpu)

12shortNormal space width (wpu)

14shortHorizontal motion units

16shortNumerator for fraction units of horizontal motionFont def

18shortPointer in font string pool of font name Font def

(see Packet 7)

201 byte Flags

21shortHash of descriptor (Match font hash value inFunction209(0xD1) Subfunction 1)

2327 bytesFont descriptor (see Font Descriptor below)

5016 bytesAFC list (prffont entry #'s, 1 (0xFF) = none)

6616 bytesChar afc list

824 bytesOrientation afc list

Font Descriptor

OffsetSizeDescriptionWhere in .PRS File

0shortCell height (5.0)(3600ths)Font def

2shortOptimal width (wpu)Font def

4shortCap height (psu)Typeface def

6shortx height (psu)Typeface def

8shortDescender height (psu)Typeface def

10shortItalic adjustment (psu, )Typeface def

123 bytesTypeface descriptorTypeface def

Low short integer:

bit 0 = 1 casual

bit 1 = 1 connected letters

bit 2 = 1 decorative

bit 3 = 1 formal

bit 4 = 1 future

bit 5 = 1 old style

bit 6 = 1 script or calligraphic

bit 7 = 1 cupped

bit 8 = 1 exaggerated

bit 9 = 1 hairline

bit 10 = 1 slab

bit 11 = 1 slanted

bit 12 = 1 transitional

bit 13 = 1 triangular

bit 14 = 1 curved or bowed diagonalsbit 15 = 1 nonconnecting enclosures

OffsetSizeDescriptionWhere in .PRS File

High byte:

bit 0 = 1 round

bit 1 = 1 square

bit 2 = 1 angular

bit 3 = 1 exaggerated

bit 4 = 1 uniform

bit 5 = 1 ball terminals

bit 6 = 1 tails

bit 7 = 1 reserved; must = 0

151 byteTypeface def flags; same format as offset 26, exTypeface def

cluding the information added for WP5.1 (for WP5.0)

161 byteHash of typeface nameTypeface def

171 byteQuality of the font (only relevant for .DRS fonts) Font def

18shortHash of font nameFont def

202 short int.Charset completeness bits Nonshareable font Def size

(The completeness bits are read from each of

the 2 short integers.)

Low Short Int.High Short Int.Meaning

Bit n =Bit n =

00Charset not supported

10Charset supported 1%25%

01Charset supported 26%59%

11Charset supported 60%100%

Note:The n in Bit n = equals the number of the character set. For example, if you wanted to check the completeness of character set zero (the ASCII character set), you would look at bit zero (0) of the low and high short integers.

24shortPoint size (5.1) (3600ths)Font def

261 byte Typeface def flagsTypeface def

1Small caps font

2Shadow font

4Outline font

8Italic or oblique

16 (0x10)PS font (font descriptor only)

Weight high three bits

00000000b extra light

00100000b light

01000000b normal

01100000b demibold

10000000b bold

10100000b heavy added for WP5.1

11000000b black added for WP5.1

11100000b ultrablack added for WP5.1

Packet Type 16 (0x10) DDE Link Packet added for WPWin5.1

The existence of this packet signifies that the document contains DDE links. The presence of this packet tells the Open and Retrieve functions to scan the document and reestablish the links.

Packet Type 16 (0x10) Total Number of Document Pages UNIX WP5.1 only

OffsetSizeDescription

0long# of pages

Packet Type 17 (0x11) Macro Executable Code added for WPWin5.1

This packet is a part of every macro file.

Packet Type 18 (0x12) Reserved

Packet Type 19 (0x13) Macro Information Block added for WPWin5.1

OffsetSizeDescription

010 bytesCreation date (if this is altered, the macro is recompiled at runtime)

Note: For creation date format, see Document Summary Packet (prefix packet 1).

10shortFile type

12shortMajor version

14shortMinor version

16shortMaintenance version

18shortLanguage (for example, US, UK, etc.)

19short# of product types in macro

The following section is repeated for each product type in offset 19 (above):

..2 short int.Product (for example, WPWP)

..shortProduct major version

..shortProduct minor version

..shortProduct maintenance version

Packet Type 20 (0x14) Reserved

Packet Type 21 (0x15) OLE Prefix added for WPWin5.2

OffsetSizeDescription

01 byteObject Information Structure major version (currently always 1)

11 byteObject Information Structure minor version (currently always 0)

2shortSize of Object Information Structure (currently always 4)

4short# of OLE objects

Note:The following information repeats for each object in the packet. Offset 4 determines how many times the information will be repeated.

6shortSize of object name (includes the NULL)

8variableObject name (nullterminated ANSI string)

..variableObject information structure (currently contains only an unsigned long integer value. The value is the size of the OLE object)

..variableOLE object

Packet Type Styles 256511 (0x100 0x1FF)

Prefix structure of style packet types. The style library file format is the same as the style prefix information.

A style is stored in the prefix in two parts:

PART_1:NameTypeDescriptionUnique#

sizes:211551

PART_2:BegSizeBegHashEndSizeEndHashXtrSizeBegTextEndText

sizes:22222....

FieldMeaning

NameA short name for the style, the actual identifier for the style

TypeInformation about the style

bit 0 set= paired type stylebit 0 clear= global type style

bit 6,7

0 = Enter = HRt

2 = Enter = Off

3 = Enter = Off/On

DescriptionA lengthy description for human use only

Unique#A # to identify this style from others

BegSizeThe size of the beginning text

BegHashThe hash value of the beginning text

EndSizeThe size of the ending text

EndHashThe hash value of the ending text

XtrSizeThe size of the extra text (auto-added to End_Text)

BegTextText and function codes in the Style On code

EndTextText and function codes in the Style Off code

XtrtextCodes added to the Style Off code

Packet Type 512 767 (0x200 0x2FF)

Structure of Prefix PS Information

The first three fields uniquely identify a PS table entry:

OffsetSizeMeaning

01 bytePS status flag (0 = bytes, 1 = short int.)

11 byteReserved

216 short int.Pointers to the 16character sets (1 = pointer is being used)

34variableChar widths

....._________________.

..char set 1 | Last char or count| Note: last char + 1 = count

....| char 0 width |

....| char 1 width |

....| .. |

....| .. |

....| .. |

....._________________.

..char set 2 | Last char or count |

....| char 0 width |

....| char 1 width |

....| .. |

....| .. |

Abbreviated Prefix

One of the following two conditions signals the end of the prefix data: when an index with a packet type of End of Prefix (0) is encountered, or when the pointer to the next index block in the special header index is equal to 0.

To quickly create a simple but valid WordPerfect document prefix, use the following information. This abbreviated prefix enables successful retrieval into WordPerfect. WordPerfect adds the remaining information when the document is saved after bringing it into WordPerfect (The following values are all in hexadecimal).

FF 57 50 43 4C 00 00 00 01 0A 00 00 00 00 00 00

FB FF 05 00 32 00 00 00 00 00 06 00 08 00 00 00

[REDACTED] 00 00 4A 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 08 00 7C 00 78 00 00 00 00 00

Note:This generic prefix is on disk so you do not have to type it in. It is saved under the filename "PREFIX.QCK." Refer to the "Toolkit Diskette" section to find which disk this file is on.