Introduction
These are the documents saved by WordPerfect 5.0 and 5.1 for DOS and 5.1 and 5.2 for Windows. WordPerfect 5 was the first version to put a header at the start of the file, so that a program can tell what a file is before reading it. After the header comes a prefix of packets (the fonts used, the graphics), then the document itself: one stream of text bytes mixed with function codes, as WordPerfect’s “reveal codes” view shows it.
Corel has not published the format, and WordPerfect’s own 5.x documentation is not published by Corel either. These pages follow libwpd, the open-source WordPerfect reader used by LibreOffice, and say where a code is not known.
Structure
The file starts with the 16-byte WPC header: FF 57 50 43, the offset of
the document area, product type 1, file type 0x0A, major version 0 and
minor version 0 or 1. The prefix starts at offset 16 and is a chain of index blocks
with packets (0xFFFB blocks of four entries). The document area starts at
the document pointer: bytes 0x20 to 0x7E are text,
0x80 to 0xBF single-byte functions, 0xC0 to
0xCF fixed-length groups and 0xD0 to 0xFE
variable-length groups. Numbers are little-endian.
16WPC header signature, document pointer, product and file type, version, encryption0x00–0x0FnPrefix packets font lists, font names, graphicsfrom 0x10nDocument area text, single-byte functions, fixed-length and variable-length groupsfrom the document pointer
The file header and encryption page covers the header, the versions and the password scrambling; the packets and function codes page the prefix packets, every code libwpd names, the attributes, tab types and character sets; and the function data page the bytes inside the groups and packets.
To tell a 5 document apart: the bytes FF 57 50 43 at the start, file type
0x0A and major version 0.
Not described
Known, not yet covered
- Reference: a description of the 5.1 format circulates as a PDF, but it is third-party material and was not used; the pages follow libwpd alone.
- Viewer: the explorer has no WordPerfect viewer. A 5 file shows as
raw bytes with its
WPCsignature. The header, packets and codes are described, so a viewer can be built.
Unknown
- Reference: the fixed-length groups
C5toCF, which libwpd lists by length and skips (fixed-length function groups). - Reference: prefix packet types other than 2, 7, 8 and 15 (printer
and document settings), and the control characters below
0x20that libwpd does not document (prefix packets). - Reference: the contents of the variable-length groups and
sub-codes that libwpd skips by their length: box types other than the ones it
reads (table, text, user, equation and lines), the
DDsub-codes and the old-value bytes inside the groups (function data).
Variants
- WordPerfect 4.2 and earlier for DOS – a headerless stream of text and function codes, described by WordPerfect Corporation’s own 1986 document
- WordPerfect for Macintosh – version 1.x headerless; versions 2.x to 3.5e with a WPC header and an embedded resource fork
- WordPerfect 5 – a WPC header, prefix packets, then the document area (DOS 5.0 and 5.1, Windows 5.1 and 5.2)
- WordPerfect 6 and later – a WPC header, an index header and packets; the layout kept by every later version
Links
Software
- LibreOffice Writer – free office suite’s word processor, which imports WordPerfect 5 documents through libwpd (Windows, macOS, Linux)
Developers
- libwpd – library that reads WordPerfect documents including 5.x, used by LibreOffice (C++)
Reference
- libwpd source code – the most complete public description of the format, in
WPXHeaderandWP5FileStructure.h