Introduction
A Windows Metafile is a recording of drawing commands from the 16-bit Windows graphics system (GDI). Playing the file back draws the picture again: lines, shapes, text and bitmaps, at whatever size is needed. It can hold vector drawing, bitmaps or both.
WMF was the usual way to move clip art and charts between Windows programs in the 1990s, and Office documents still embed it. Its 32-bit successor is the Enhanced Metafile (EMF).
Structure
A WMF file is a header followed by records. Each record is its size in 16-bit words (4 bytes), a 2-byte function number naming the GDI call, and that call's parameters. All numbers are little-endian. The last record is an end-of-file record of three words with function number 0.
Many files start with an extra 22-byte "placeable" header, added by Aldus, that gives
the picture's bounding box and its units per inch. It begins with the key
D7 CD C6 9A. The standard 18-byte header comes after it, or first in a
file without it.
0Placeable header optional, keyD7 CD C6 9A, bounds, units per inch22 bytes22Header type, header size, version, file size, object count18 bytes40Records size, function number, parametersvaries…End of file record03 00 00 00 00 006 bytes
Links
Software
- LibreOffice (Windows, macOS, Linux)
- Inkscape (Windows, macOS, Linux)
- Microsoft Word and PowerPoint (Windows, macOS)
- IrfanView (Windows)
- XnView MP (Windows, macOS, Linux)
Reference
- [MS-WMF]: Windows Metafile Format, Microsoft's published specification