Convert WMF metafile to SVG format using Aspose.Imaging for Java 16.10

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Imaging for Java logo We are pleased to announce the release of Aspose.Imaging for Java 16.10. The major development in this release is support for converting WMF metafile to SVG format. Manipulate large TIFF files (e.g. size 500MB) enhancement has also been incorporated in this release.

Convert WMF To SVG

Using Aspose.Imaging for Java developers can convert WMF to SVG format. Aspose.Imaging for Java provides SvgOptions class to create SVG format image. Below is the code demonstration of the said functionality.



// Path & Name of input file
String inputFileName = "sample.wmf";

// Path & Name of output file
String outputFileName = inputFileName + ".svg";

// Create an instance of Image class by loading an existing WMF image.
com.aspose.imaging.Image image = com.aspose.imaging.Image.load(inputFileName, new com.aspose.imaging.imageloadoptions.MetafileLoadOptions(true));
try
{
        // Create an instance of EmfRasterizationOptions class.
        final com.aspose.imaging.imageoptions.EmfRasterizationOptions options = new com.aspose.imaging.imageoptions.EmfRasterizationOptions();
        options.setPageWidth(image.getWidth());
        options.setPageHeight(image.getHeight());
        
        // Call save method to convert WMF to SVG format by passing output file name and SvgOptions class instance.
        image.save(outputFileName, 
                new com.aspose.imaging.imageoptions.SvgOptions()
                {
                    {
                        setVectorRasterizationOptions(options);
                    }
                }
        );
}
finally
{
        image.dispose();
}

Enhancements

Following enhancements have been introduced in this release.

  • Process of generating EMF image has been improved.

  • Process of converting EMF to PNG has been improved.

  • Process of extracting layer/nested layers name in PSD file has been improved.

  • Process of manipulating large TIFF files (e.g. size 500MB) has been improved.

  • Process of getting RGB pixels from image type Jpeg2000 has been improved.

Please refer to the release notes of Aspose.Imaging for Java 16.10 for a full view of improvements along with sample code snippets for newly added features. If you are planning to upgrade the API to the latest revision, we strongly suggest you to check the Public API Changes section to know what has been changed in the public API since your current version.

Aspose.Imaging for Java Resources

The resources, you may need to accomplish your tasks:

As always we appreciate your feedback so if you ever have anything to tell us about this release or anything else, please head to the Aspose.Imaging forum for a chat.