A portable library for reading and writing WMF, EMF and EMF+ files
Microsoft's WMF, EMF, and EMF+ metafile types are supported. In each case functions are provided for reading, constructing, writing, and printing metafile records. The methods used to do that differ somewhat between metafiles, and the simplest way to get started is to have a look at the example programs provided. The WMF, EMF, and EMF+ structs and functions are marked with U_WMF, U_EMF, U_PMF and U_WMR, U_EMR, and U_PMR prefixes. (PMF because "+" is a reserved character in many contexts, so U_EMF+NAME would be a problem.) Please be aware that normally both EMF and EMF+ files have the ".emf" file extension, and that it is very common for such files to contain both an EMF and an EMF+ representation of the drawing.
testbed_emf.c Creates an EMF file test_libuemf.emf.
testbed_wmf.c Creates a WMF file test_libuemf.wmf.
testbed_pmf.c Creates an EMF+ file test_libuemf_p.emf.
reademf.c Reads an EMF or EMF+ file and emits a text summary of its records.
readwmf.c Reads a WMF file and emits a text summary of its records.
emf-inout.cpp.example Example code from Inkscape to convert graphics from EMF to SVG.
emf-print.cpp.example Example code from Inkscape to print a drawing to EMF.
wmf-inout.cpp.example Example code from Inkscape to convert graphics from WMF to SVG.
wmf-print.cpp.example Example code from Inkscape to print a drawing to WMF.
There are currently some unresolved issues with Doxygen that result in some structs not being "defined". This comes up when several different types of structs have the same layout. When this occurs the first one listed on the "typedef struct" is defined but all the others will only be shown under "typedef struct" referring to the first one. This is why clicking on U_RECTL in a function parameter jumps to a typedef struct page, why U_RECTL is shown as plain text here, but U_RECT is shown as a link here, and clicking on it jumps directly to its structure definition.
An additional issue is that the Enumeration names used in WMF are different from those used in EMF, even when the values are either identical or differ only slightly, and no method has been found yet to link one to the other in Doxygen. At present the only way to look up these WMF enumerations is by referencing the following table:
EMF WMF WMF Manual EMF Binary Raster Operation Enumeration BinaryRasterOperation Enumeration 126.96.36.199 EMF Bitcount Enumeration BitCount Enumeration 188.8.131.52 EMF LB_Style Enumeration BrushStyle Enumeration 184.108.40.206 EMF LF_CharSet Enumeration CharacterSet Enumeration 220.127.116.11 EMF DIBColors Enumeration ColorUsage Enumeration [has 1 extra value] 18.104.22.168 EMF BI_Compression Enumeration Compression Enumeration [has 3 extra values] 22.214.171.124 - FamilyFont Enumeration 126.96.36.199 EMF FloodFill Enumeration FloodFill Enumeration 188.8.131.52 EMF LF_Quality Enumeration FontQuality Enumeration 184.108.40.206 EMF LCS_Intent Enumeration GamutMappingIntent Enumeration 220.127.116.11 EMF HatchStyle Enumeration HatchStyle Enumeration 18.104.22.168 EMF Mirroring Enumeration LayoutEnumeration 22.214.171.124 - LogicalColorSpace Enumeration 126.96.36.199 EMF Profile Enumeration LogicalColorSpaceV5 Enumeration 188.8.131.52 EMF MapMode Enumeration MapModeEnumeration 184.108.40.206 - MetaFilesEscape Enumeration 220.127.116.11 - MetafileType Enumeration 18.104.22.168 - MetafileVersion Enumeration 22.214.171.124 EMF BackgroundMode Enumeration MixModeEnumeration 126.96.36.199 EMF LF_OutPrecision Enumeration OutPrecision Enumeration 188.8.131.52 - PaletteEntryFlag Enumeration 184.108.40.206 EMF PenStyle Enumeration PenStyle Enumeration [not values >0xFFFF] 220.127.116.11 - PitchFont Enumeration 18.104.22.168 EMF PolygonFillMode Enumeration PolyFillMode Enumeration [first 2 only] 22.214.171.124 - PostScriptCap Enumeration 126.96.36.199 - PostScriptClipping Enumeration 188.8.131.52 - PostFeatureSetting Enumeration 184.108.40.206 - PostScrioptJoin Enumeration 220.127.116.11 EMF StretchMode Enumeration StretchMode Enumeration 18.104.22.168 EMF Ternary Raster Operation Enumeration TernaryRasterOperation Enumeration 22.214.171.124 EMF LF_ClipPrecision Enumeration ClipPrecision Flags 126.96.36.199 EMF ExtTextOutOptions Enumeration ExtTextOutOptions Flags [subset] 188.8.131.52 EMF TextAlignment Enumeration TextAlignment Enumeration 184.108.40.206 EMF TextAlignment Enumeration VertialTextAlignment Enumeration 220.127.116.11 EMF LF_PitchAndFamily Enumeration PitchAndFamily Enumerations 18.104.22.168
Manual Date Link EMF 3/28/2012 http://msdn2.microsoft.com/en-us/library/cc230514.aspx EMF+ 7/5/2012 http://msdn.microsoft.com/en-us/library/cc230724.aspx WMF 7/5/2012 http://msdn2.microsoft.com/en-us/library/cc250370.aspx