Introduction
These are the documents saved by WordPerfect
from version 6.0 up to the WordPerfect Office of today, which Corel has made since
1996. WordPerfect 6.0 introduced the format that every later version still writes,
marked by major version 2 in the WPC header. New versions add codes and packets but
keep the layout, which is why .wpd files from version 6 onwards open in
each other.
Corel has not published the format. 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 2, the
minor version, an encryption field and the offset of the index header. In 6.1 and
later the document size follows at offset 20. The index header lists the packets
(fonts, styles, summary, graphics) in 14-byte entries. The document area is a stream
where 0x00 is ignored, 0x01 to 0x20 are
extended international characters, 0x21 to 0x7F ASCII text,
and the higher bytes single-byte functions, variable-length groups and fixed-length
groups. Numbers are little-endian.
16WPC header signature, document pointer, product and file type, version, encryption, index header offset0x00–0x0FnIndex header and packets the packet index, then the packets it listsfrom the index header offsetnDocument area text, single-byte functions, variable-length and fixed-length groupsfrom the document pointer
The file header and encryption page covers the header, the versions and the encryption; the packets and function codes page the index header, every packet type and every code libwpd names, the attributes, tab types, character sets and units; and the function and packet data page the bytes inside the groups and packets.
To tell a 6 or later document apart: FF 57 50 43 at the start, file type
0x0A and major version 2.
Not described
Known, not yet covered
- Reference: a software development kit for 6.x documents circulates as an archive, but it is not an original publication and was not used; the pages follow libwpd alone.
- Viewer: the explorer has no WordPerfect viewer. A 6 or later file
shows as raw bytes with its
WPCsignature. The header, packets and codes are described, so a viewer can be built.
Unknown
- Reference: the encryption of 6.x files. libwpd flags an encrypted file and does not decrypt it, and no public description exists (encryption).
- Reference: the four bytes at offsets 16 to 19 of the header, which libwpd does not read, and the minor version numbers written by each release after 6.0 (versions).
- Reference: the packet types libwpd does not name, the function
codes it lists as unknown and the sub-codes
0xE3to0xEF, and everything it skips by length (packets and function codes, function and packet data). - Reference: table cell item 138 and the items above 143, and the table, column-border and style data libwpd does not read (function and packet 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
- WordPerfect Office – Corel’s office suite, which makes the format (Windows)
- LibreOffice Writer – free office suite’s word processor, which imports WordPerfect documents (Windows, macOS, Linux)
Developers
- libwpd – library that reads WordPerfect documents, used by LibreOffice (C++)
Reference
- libwpd source code – the most complete public description of the format, in
WPXHeaderandWP6FileStructure.h