Introduction
The Enhanced Metafile is the 32-bit successor to the Windows Metafile (WMF). It records calls to the Windows graphics system (GDI) so they can be played back to draw the picture again at any size. It came with the 32-bit versions of Windows in the early 1990s.
EMF is used for clipboard pictures, print spooling and charts and drawings embedded in Office documents. A later extension, EMF+, adds records for GDI+ drawing inside the same file.
Structure
An EMF file is a list of records, all little-endian. Each record starts with a 4-byte
type and a 4-byte size in bytes. The first record is the header (type 1), which gives
the picture's bounds and physical size, the signature 20 45 4D 46
(" EMF") at offset 40, the version, the file size and the number of records. The last
record is end-of-file (type 14).
EMF+ drawing is stored in comment records, so a program that only knows plain EMF can still draw the plain records that usually follow as a fallback.
0Header record type 1, size, bounds, frame, signatureEMFat 40, version, countsvaries…Drawing records type, size, parametersvaries…End-of-file record type 1420 bytes or more
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-EMF]: Enhanced Metafile Format, Microsoft's published specification
- [MS-EMFPLUS]: Enhanced Metafile Format Plus Extensions, Microsoft