This article shows you how to convert EMF files into SVG files using our JDeli Java Image library. We also have a related article covering how to read EMF files in Java that might interest you.
What is EMF?
The filename extension for EMF files is: .emf
Why convert EMF files to SVG
The EMF file format has been around for a long time so many Companies have a big investment in EMF files. And the EMF format is not heavily supported outside the Windows world. SVG is a very popular cross-platform format that is supported by all modern Browsers and many tools on Windows, Mac, and Linux. It is also a Vector format so converted content retains the benefits of being easily rescaled.
How to convert EMF 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 EMF file
File emfFile = new File("/path/to/emfFile.emf"));
- Create a File (or OutputStream) object for the converted SVG output
File svgFile = new File("/path/to/svgFile.svg"));
- Step 4 Pass the File (or OutputStream) objects into a static method
EmfDecoder.toSVG(emfFile,svgFile);