Amy Pearson Amy is the product lead for JDeli with expertise in image code, Java, web development, and cloud computing. She focuses on JDeli and has also contributed to JPedal, cloud services, and support. Outside work, she enjoys gaming, F1, and music.

How to convert WMF files to SVG in java with JDeli

1 min read

WMF to SVG

This article will show you how to convert WMF files into SVG files. We also have a related article covering how to read WMF files in Java that might interest you.

WMF to SVG

What is WMF?

WMF is a file format designed for the Windows platform by Microsoft. WMF stands for Windows MetaFile and it is a Vector file format, meaning it scales well if you need to resize. You can learn more about them in our post “What are the WMF and EMF image file formats?”.

The file name extension for WMF files is: .wmf

Why convert WMF files to SVG

The WMF file format has been around for quite some time. As a result, many companies have lots of WMF files. However, outside of the Windows world, the WMF format is not heavily supported. SVG is also a Vector file format so converted content keeps the benefits of being rescaled easily. In contrast to WMF, SVG is a very popular cross-platform format that is supported by all modern Browsers and many tools on Windows, Mac, and Linux.

How to convert WMF file to SVG in JDeli

  1. Add JDeli to your class or module path. (download link to the trial jar). JDeli is the best enterprise-level Java image library for image manipulation.
  2. Create a File (or InputStream) object for the WMF file
    File wmfFile = new File("/path/to/wmfFile.wmf"));
  3. Create a File (or OutputStream) object for the converted SVG output
    File svgFile = new File("/path/to/svgFile.svg"));
  4. Pass the File (or OutputStream) objects into a static method
    WmfDecoder.toSVG(wmfFile,svgFile);

In this tutorial you learned how to change WMF files to SVG using JDeli. We have other blog posts on conversion between different file formats as well, please feel free to check them out.



Are you a Java Developer working with Image files?

Amy Pearson Amy is the product lead for JDeli with expertise in image code, Java, web development, and cloud computing. She focuses on JDeli and has also contributed to JPedal, cloud services, and support. Outside work, she enjoys gaming, F1, and music.