Does anybody know of a library or a piece of code that can read EMF (Enhanced Metafiles). Ideally it would convert an EMF to a list of drawing commands and objects?
4 Answers
The Apache Image Loader Framework (Java) can read EMF file and convert then to SVG, it can also read WMF using 3rd party plugin.

- 31,691
- 7
- 68
- 87
-
2As I found, EMF, unfortunately, is not fully supported by xmlgraphics. http://xmlgraphics.apache.org/fop/0.95/graphics.html#emf When I tried to read EMF file it thrown an error: "no suitable loader/converter combination available" And adding FOP dependency didn't fix it. P.S. Also, just for sharing my experience to save your time - FreeHep also is not working correctly with EMF. So, don't waste your time trying to run it - it's totally buggy. – Gadget Nov 27 '14 at 23:35
What language are you working in ? You might look at our MetaDraw ( available as OCX or .NET Winforms component ) This will load EMF files and allow you to cycle through the elements ( lines, shapes, text ). You can then identify the parameters ( coordinates, line thickness, colors, etc) More details at www.MetaDraw.com
LibreOffice can do it. There is also a python utility called unoconv which will do it (using installed LibreOffice libraries). You could look at those for some hints on how it's done, since they're open source.

- 1,243
- 1
- 16
- 27
Wikipedia article on Windows Metafile has a lot of relevant information on EMF. Check external links for libraries and format specification.

- 6,677
- 9
- 26
- 27