Vector Graphics Editor
libUEMF overview


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.

Example Programs

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.

Documentation issues

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      
    EMF Bitcount Enumeration                   BitCount Enumeration                   
    EMF LB_Style Enumeration                   BrushStyle Enumeration                 
    EMF LF_CharSet Enumeration                 CharacterSet Enumeration               
    EMF DIBColors Enumeration                  ColorUsage Enumeration  [has 1 extra value]
    EMF BI_Compression Enumeration             Compression Enumeration [has 3 extra values]
    -                                          FamilyFont Enumeration                 
    EMF FloodFill Enumeration                  FloodFill Enumeration                  
    EMF LF_Quality Enumeration                 FontQuality Enumeration                
    EMF LCS_Intent Enumeration                 GamutMappingIntent Enumeration         
    EMF HatchStyle Enumeration                 HatchStyle Enumeration                 
    EMF Mirroring Enumeration                  LayoutEnumeration                      
    -                                          LogicalColorSpace Enumeration          
    EMF Profile Enumeration                    LogicalColorSpaceV5 Enumeration        
    EMF MapMode Enumeration                    MapModeEnumeration                     
    -                                          MetaFilesEscape Enumeration            
    -                                          MetafileType Enumeration               
    -                                          MetafileVersion Enumeration            
    EMF BackgroundMode Enumeration             MixModeEnumeration                     
    EMF LF_OutPrecision Enumeration            OutPrecision Enumeration               
    -                                          PaletteEntryFlag Enumeration           
    EMF PenStyle Enumeration                   PenStyle Enumeration [not values >0xFFFF]
    -                                          PitchFont Enumeration                  
    EMF PolygonFillMode Enumeration            PolyFillMode Enumeration [first 2 only]
    -                                          PostScriptCap Enumeration              
    -                                          PostScriptClipping Enumeration         
    -                                          PostFeatureSetting Enumeration         
    -                                          PostScrioptJoin Enumeration            
    EMF StretchMode Enumeration                StretchMode Enumeration                
    EMF Ternary Raster Operation Enumeration   TernaryRasterOperation  Enumeration    
    EMF LF_ClipPrecision Enumeration           ClipPrecision Flags                    
    EMF ExtTextOutOptions Enumeration          ExtTextOutOptions Flags [subset]       
    EMF TextAlignment Enumeration              TextAlignment Enumeration              
    EMF TextAlignment Enumeration              VertialTextAlignment Enumeration       
    EMF LF_PitchAndFamily Enumeration          PitchAndFamily Enumerations            

Reference documentation

    Manual   Date        Link
    EMF      3/28/2012
    EMF+     7/5/2012
    WMF      7/5/2012