Open an EMF or WMF picture without Office
Someone sent you an .emf or .wmf, or you pulled one out of a Word, PowerPoint or Visio file, and nothing on your phone or Mac shows it. Drop it here: it is drawn in this tab, and you can save it as a PNG (at its own size or twice that) or as an SVG. Below the picture: its size in millimetres, its DPI, the fonts and text in it, every embedded bitmap (each savable) and a count of every record.
The file is read by this tab on your device and is not uploaded, so a company logo or an unreleased chart goes nowhere.
What it shows
- The picture, drawn from its records. A metafile is a recording of Windows drawing calls: “select a red brush”, “draw a rectangle”, “write this text in Arial 12”. This page plays them back on a canvas: lines and pens with their widths and dash styles, filled shapes, polygons, Bézier curves, arcs and pies, paths and clipping, text in the named font, and embedded bitmaps, under the file’s own coordinate mapping and transforms.
- Save as PNG, 1x or 2x. 1x is the picture’s physical size at 96 dpi (a 50 mm wide logo becomes 189 pixels); 2x doubles it for sharp results on high-density screens and in slides. The background is transparent. The longest side is capped at 8,192 pixels.
- Save as SVG. The same drawing as SVG paths and text, so it stays sharp at any size and can be edited in Inkscape or Illustrator. Bitmaps stored in the metafile go into the SVG as images.
- Size, bounds and DPI. For an EMF, the picture frame in millimetres, the bounds in device pixels and the DPI of the screen or printer it was recorded on. For a WMF, the bounding box and “units per inch” of the placeable header, when it has one.
- Fonts and text. Every font the picture creates and every string it draws, decoded in the font’s own code page (Japanese, Cyrillic, Greek and the rest come out as text, not mojibake), so you can copy the words out of a chart or diagram.
- Embedded bitmaps. Each pixel picture inside (photos pasted into a Visio drawing, logos, pattern brushes) with its size and colour depth, savable on its own as PNG, or as the original JPEG or PNG when it was stored that way.
- Every record, counted. The record types by name (EMR_POLYGON16, META_STRETCHDIB …), with unknown ones counted and skipped rather than stopping the drawing.
Where these files come from
- EMF (Enhanced Metafile, 1993 on)
- The vector format of Windows since Windows NT 3.1 and 95: 32-bit coordinates, a header with the picture’s size in hundredths of a millimetre, and records of a 4-byte type and a 4-byte size. Excel charts and Visio shapes copied to the clipboard become EMF, and Word and PowerPoint store pasted vector pictures as
word/media/image1.emforppt/media/image3.emfinside the .docx or .pptx (rename a copy to .zip to get at them). - WMF (Windows Metafile, Windows 3.x)
- The 16-bit predecessor, still common in clip-art collections and old Office documents. Coordinates are 16-bit; the physical size is only known when the file starts with the 22-byte “placeable” header (key
D7 CD C6 9A), which gives a bounding box and how many units make an inch. Without it, a WMF has no size of its own and this page fits it to the screen. - EMZ and WMZ
- An EMF or WMF compressed with gzip. Office writes these inside some documents; they are unpacked here in the tab with the vendored fflate library.
- EMF+
- GDI+ drawing (anti-aliased, with transparency and gradients) stored in comment records inside an EMF. Most EMF+ files are “Dual”: they also carry the plain EMF records for the same picture, which this page draws. An EMF+-only file has no such copy, and the page says so instead of showing an unexplained blank.
How the file is read
- Written from Microsoft’s specifications
- The reader and renderer were written for this site from the published open specifications [MS-EMF] (Enhanced Metafile Format) and [MS-WMF] (Windows Metafile Format), with the section numbers cited in the code; [MS-EMFPLUS] is used only to recognise EMF+ records. No code from LibreOffice, libwmf, libemf or any other metafile reader is used.
- Coordinates
- EMF records are mapped through the world transform, the window and viewport and the mapping mode (pixels, 0.1 mm, 0.01 mm, 0.01 inch, 0.001 inch, twips, isotropic or anisotropic) to the reference device, then the header’s frame is fitted to the screen. In a WMF, the window is mapped onto the placeable bounding box, as Office and LibreOffice do.
- Tested on
- Seven real metafiles from the Apache POI project’s test files (Apache License 2.0), including a Japanese project schedule, an equation, clip art, a flow diagram and two EMF+ Dual files (a scatter plot and an embedded-file icon), plus generated files built record by record from the specifications.
What this cannot do
- Draw EMF+-only pictures. GDI+ records (EMF+) are recognised and counted, not drawn. Dual files are drawn from their plain EMF copy, which may look slightly rougher: no anti-aliasing hints, no GDI+ gradients or transparency.
- Every raster operation. The common bitmap operations (copy, AND, OR, XOR) are drawn with the closest canvas blend; rarer raster ops and line mix modes (SetROP2) are drawn as a plain copy and listed under “Not drawn”. Mask and parallelogram blits, flood fills and region inversions are skipped and listed.
- Printer escapes and OpenGL. Device escapes (printer-specific PostScript passthrough, EMR_EXTESCAPE, META_ESCAPE) and OpenGL records only mean something to the device they were made for; they are counted, not drawn.
- Missing fonts. Text uses the fonts installed on this device. A font the picture names but you do not have is replaced, so text can come out wider or narrower than intended.
- Hatched and pattern brushes in SVG. On screen and in PNG they are drawn as patterns; the SVG gets their average colour. Clip regions combined with OR or XOR are approximated.
- Edit. It only draws and saves. To edit the drawing, open the SVG in Inkscape or the metafile in LibreOffice Draw.
Other ways to open them
- Windows
- Paint opens .emf and .wmf (and rasterises them); Word, PowerPoint and Visio insert them as editable pictures.
- LibreOffice Draw and Inkscape (free, every platform)
- Both import EMF and WMF and can export PDF or SVG. LibreOffice also draws EMF+, so it is the one to try for an EMF+-only file.
- macOS and phones
- Preview, Photos and the phone galleries do not open metafiles at all, which is when a page like this one helps.