WordPerfect 6 and later documents start with a 16-byte header whose bytes 1 to 3 are
WPC. It says where the document text starts, what kind of file it is and
which version wrote it. Corel’s own format documentation is not freely published; this
page follows libwpd, the open-source WordPerfect reader used by LibreOffice, and says
where something is not known.
The WPC header
Numbers are little-endian.
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 1 | – | 0xFF. |
1 | 3 | Signature | WPC (57 50 43). A reader checks these three bytes. |
4 | 4 | Document pointer | Offset of the start of the document area (the text and codes), after the packets. |
8 | 1 | Product type | The program family that wrote the file: 1 for WordPerfect. |
9 | 1 | File type | 0x0A WordPerfect document. Other values are other WordPerfect Corporation files (templates, macros, dictionaries and so on), which libwpd does not read. |
10 | 1 | Major version | 2 for every 6.x-format file. |
11 | 1 | Minor version | See versions. |
12 | 2 | Encryption | 0 when the file is not encrypted; otherwise non-zero (see encryption). |
14 | 2 | Index header offset | Offset of the index header. Values below 16 mean 16. |
16 | 4 | Not read | libwpd reads nothing at offsets 16 to 19, and no public source says what those four bytes hold. |
20 | 4 | Document size | The size of the document (the offset of its end). Present in 6.1 and later files; 6.0 files do not have this field. |
Versions
| File type | Major | Minor | Format |
|---|---|---|---|
0x0A | 2 | 0 | WordPerfect 6.0, without the document size field. |
0x0A | 2 | 1 and later | WordPerfect 6.1 and every later version up to today’s WordPerfect Office, with the size field. New versions add codes and packets but keep the layout, which is why .wpd files from version 6 onwards open in each other. |
The exact minor numbers written by every 6.x-format release (6.1, 7, 8, 9, X3 and later) are not given by libwpd, which treats them all alike, so they are unknown here.
Encryption
When the encryption field of a 6.x-format file is not 0 the file is encrypted. libwpd does not decrypt it and reports any encrypted file with major version 2 as using an unsupported encryption. No description of WordPerfect’s encryption was ever made available by WordPerfect or its later owners (WordPerfect for DOS Updated), so the 6.x method is unknown.
Example
The start of a WordPerfect 6.1-format document whose text begins at offset 0x05D4,
built from the fields above (not taken from a particular file; xx marks
bytes whose meaning is not public):
00000000 FF 57 50 43 D4 05 00 00 01 0A 02 01 00 00 00 02 .WPC............
00000010 xx xx xx xx 7A 1E 00 00 ....z...
| Bytes | Field | Value |
|---|---|---|
FF 57 50 43 | Signature | .WPC |
D4 05 00 00 | Document pointer | 0x05D4 = 1,492 |
01 | Product type | WordPerfect |
0A | File type | Document |
02 01 | Version | Major 2, minor 1: the 6.1 layout |
00 00 | Encryption | Not encrypted |
00 02 | Index header offset | 0x0200 = 512 |
xx xx xx xx | (Bytes 16–19) | Not read by libwpd; not publicly documented |
7A 1E 00 00 | Document size | 0x1E7A = 7,802 bytes |