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.
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
- Add JDeli to your class or module path. (download link to the trial jar).
- Create a File (or InputStream) object for the WMF file
File wmfFile = new File("/path/to/wmfFile.wmf"));
- Create a File (or OutputStream) object for the converted SVG output
File svgFile = new File("/path/to/svgFile.svg"));
- Pass the File (or OutputStream) objects into a static method
WmfDecoder.toSVG(wmfFile,svgFile);
Are you a Java Developer working with Image files?
// Read an image
BufferedImage bufferedImage = JDeli.read(dicomImageFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(heicImageFile);
// Write an image
JDeli.write(bufferedImage, "heic", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(jpegImageFile);
// Write an image
JDeli.write(bufferedImage, "jpeg", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(jpeg2000ImageFile);
// Write an image
JDeli.write(bufferedImage, "jpx", outputStreamOrFile);
// Write an image
JDeli.write(bufferedImage, "pdf", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(pngImageFile);
// Write an image
JDeli.write(bufferedImage, "png", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(tiffImageFile);
// Write an image
JDeli.write(bufferedImage, "tiff", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(webpImageFile);
// Write an image
JDeli.write(bufferedImage, "webp", outputStreamOrFile);
What is JDeli?
JDeli is a commercial Java Image library that is used to read, write, convert, manipulate and process many different image formats.
Why use JDeli?
To handle many well known formats such as JPEG, PNG, TIFF as well as newer formats like AVIF, HEIC and JPEG XL in java with no calls to any external system or third party library.
What licenses are available?
We have 3 licenses available:
Server for on premises and cloud servers, Distribution for use in a named end user applications, and Custom for more demanding requirements.
How does JDeli compare?
We work hard to make sure JDeli performance is better than or similar to other java image libraries. Check out our benchmarks to see just how well JDeli performs.