Metafile Format

Last updated -[Tue Nov 23 14:10:44 1999 by cxh]-
Metafile format is a Windows format used to store pictures. Rather than using bitmaps, metafiles use operation primitives like draw and line.

Two formats:

  • .emf Win32 enhanced metafiles
  • .wmf Windows 3.x metafiles
  • http://www.whatis.com/metafile.htm says

    Another example of a metafile is the Computer Graphics Metafile (CGM). The CGM file format is a standard (ANSI-approved) format that can be used on any operating system that supports it (unlike the WMF format which is designed only for Windows). The CGM file is commonly used in CAD and presentation graphics applications.

    In general, there are tools (such as HiJaak) that will convert the WMF, EMF, and CGM formats into other formats.

    Framemaker

    Framemaker 5.1 under Solaris can only read .wmf files
  • /usr/sww/frame-5.1/bin/wmf2fmvect is a script that runs fmgfxfilter to convert to a Frame vector graphics filter.
  • The Frame scripts that convert can be found in /usr/sww/frame-5.1/bin/scripts Other formats include
    cdr2fmvect
    corel draw (cdr) to frame vector graphics filter
    cgm2fmvect
    cgm to frame vector graphics filter
    drw2fmvect
    micrografx to frame vector graphics filter
    dxf2fmvect
    autocad (dxf) to frame vector graphics filter
    gem2fmvect
    gem to frame vector graphics filter
    hpgl2fmvect
    hpgl to frame vector graphics filter
    iges2fmvect
    igs to frame vector graphics filter
    pict2fmvect
    QuickDraw Pict to frame vector graphics filter
    wmf2fmvect
    Windows meta file to frame vector graphics filter
    wpg2fmvect
    WordPerfect graphics to frame vector graphics filter
  • Metafile resources

  • http://www.faqs.org/faqs/graphics/fileformats-faq/part3/index.html has a number of links (search for wmf to get to the relevant part)
    Unfortunately most of the urls mentioned are dead.
    Subject: WMF - Microsoft Windows Metafile
    
             Type: Metafile
        Extension: WMF
          Version: 
      Compression: None
      Color Depth:
       Maintainer: Microsoft Corporation
    Specification:
    
    WMF is the native vector file format for the Microsoft Windows operating
    environment. WMF files are actually a collection of GDI (Graphics Device
    Interface) function calls also native to the Windows environment. When a WMF
    file is "played back" (typically using the Windows PlayMetaFile() function)
    the graphics is rendered. WMF files are device-independant and have no limit
    to their size.
    
    Most books on Microsoft Windows programming contain sections on the internals
    of WMF files. The closest thing Microsoft has for a specification for the WMF
    format is in Volume 4 of the Microsoft Windows Software Development Kit
    Programmer's Reference. Chapter 3 details the internals of the Metafile
    Format.
    
    The Microsoft Knowledge Base (available at ftp://ftp.microsoft.com/kb/ and on the
    Microsoft Developer Network CD) also contains the complete specification of
    WMF. I also highly recommend the book:
    
      Inside Windows File Formats, Tom Swan, Sams Publishing 1993.
      ISBN 0-672-30338-8 $24.95 softcover, 337 pages.
    
    The placeable metafile format was created by Aldus Corp. to allow the 
    positioning of a Windows metafile on a printed page. These metafiles have
    a 22-byte header then must be stripped before they can be used by the
    Windows API. Have a look at the following Microsoft Knowledge Base article:
    
      ftp://ftp.microsoft.com/Softlib/MSLFILES/METAFILE.EXE
      This archive contains the METAFILE.HLP help file that describes
      the WMF file format.
    
      ftp://ftp.microsoft.com/Softlib/MSLFILES/PLAYMETA.EXE
      This archive contains sample Windows code to manipulate WMF files.
    
      ftp://ftp.microsoft.com/developr/MSDN/OctCD/METAFI.ZIP
      This archive contains the METAFI.HLP help file that describes
      the WMF file format. 
    
    Also have a look at:
    
      http://www.r2m.com/windev/
        Internet Resources for Windows Developers
    
    
    
  • C. Wayne Brown and Barry J. Shepherd, Graphics File Formats: Reference and Guide, Manning Publications Co., ISBN 1-884777-00-7, 1995.
    has an appendix that describes .wmf files: http://www.manning.com/Brown/index.html
  • Companion Software Metafile FAQ:http://www.companionsoftware.com/PR/WMRC/index.html#Metafile FAQs:
  • The Microsoft Developer's Network (MSDN) CDs at http://msdn.microsoft.com/ are the best source for information about Metafiles
    An April 1996 MSDN said
    For information about the format of metafile records and descriptions of their contents, see the Microsoft Windows Programmer's Reference, Vol 4
  • I was able to install a more recent version of MSDN by installing Visual C++ 6.0 and then installing the MSDN. I found some information about the format, but nothing totally obvious.
  • Some of the metafile hex values are defined in wingdi.h, which I found at c:\Program Files\DevStudio\Vc\include\wingdi.h
  • The MSDN site has some references, though you have to join MSDN first (it is free):
  • Enhanced Metafiles in Win32: http://premium.microsoft.com/msdn/library/techart/msdn_enhmeta.htm - This is a fairly long description of the format
  • http://premium.microsoft.com/msdn/library/sdkdoc/gdi/metafile_5iur.htm
  • http://premium.microsoft.com/msdn/library/sdkdoc/gdi/metafile_2fj9.htm Metafile Reference
  • Software

  • File Format Encyclopedia: http://www.ermes.it/pws/mesk/FFE.HTM - It is in SWAG format, which requires a reader.
  • Piet Jonas has some non-freeware applets at: "http://www.physik.uni-greifswald.de/~jonas/#Java
  • Axiom Software Development has a JDK1.2 'JMF' applet that can be used to display wmf files: http://www.asd.ie/Irish.htm.
    Basically, a Windows only non-java binary is used to convert images from WMF to JMF, which the applet can then display. Formerly, this software had a license fee, which has since been dropped.
  • http://www.microsoft.com/gallery/tools/wmfcnv/wmfcnv.asp contains a Windows tool that reads metafiles and converts them to raw data and Microsoft Structure Graphics format.
  • http://www.lake.de/home/lake/p60/wmf2eps/
    wmf2eps: CTAN:/support/wmf2eps
    
  • Bart Kienhuis says:
    I found a very useful tool that might also be handy for you. The tool can convert PS or PDF into different vector graphical formats. It can convert Postscript into a Windows Meta File which you can than import into PowerPoint or other Window programs. And the generated WMF can still be added and/or changed where necessary.

    Bart

    Link: http://www.geocities.com/SiliconValley/Network/1958/pstoedit/

    > pstoedit 3.1x
    > 
    > pstoedit translates PostScript and PDF graphics into other vector formats. Currently pstoedit can generate the following formats: 
    > 
    >        Tgif .obj format (for tgif version >= 3) 
    >        .fig format for xfig 
    >        pdf - Adobe's Portable Document Format 
    >        gnuplot format 
    >        Flattened PostScript (with or without Bezier curves) 
    >        DXF - CAD exchange format 
    >        LWO - LightWave 3D 
    >        RIB - RenderMan 
    >        RPL - Real3D 
    >        Java applet 
    >        Idraw format 
    >        Tcl/Tk 
    >        HPGL 
    >        AI (Adobe Illustrator) (base on ps2ai.ps - not a real pstoedit driver - see notes below and manual) 
    >        Windows Meta Files (WMF) (Windows 9x/NT only) 
    >        Enhanced Windows Meta Files (EMF) (Windows 9x/NT only) 
    >        OS/2 meta files (OS/2 only (currently not up-to-date)) 
    >        PIC format for troff/groff 
    >        MetaPost format for usage with TeX/LaTeX 
    >        Killustrator 
    >        GNU Metafile (plotutils / libplot) 
    >        Sketch  ( http://www.online.de/home/sketch/ ) 
    > 
    > The following formats are available as additional plugins on a shareware basis. See http://www.geocities.com/SiliconValley/Network/1958/plugins/ for more details. 
    > 
    >        (Frame)Maker Intermediate Format (MIF) 
    >        CGM Format (both binary and textual) 
    >        Better Enhanced Windows Meta Files (EMF) (supports curves and compound pathes and does more accurate text formatting) (Windows 9x/NT only) 
    >        RTF (MS Word)