We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

What is the preferred way to convert WMF to PNG

Code 1

Image image = Image.load(inputFileName);
final EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
PngOptions options = new PngOptions();
image.save(outputFileName, options);

Code 2

WmfMetafileImage image = new WmfMetafileImage(new ByteArrayInputStream(inputBytes));
image.save(outputFileName, new PngOptions());

Code 1 comes from Aspose.Imaging for Java
Code 2 comes from Aspose forum
So which one is preferable(better)?


I have observed your requirements and suggest you to please try using sample examples given over this documentation link. Please feel free to share if there is any further help needed in this regard.

@mudassir.fayyaz However, I found that using code 2 to convert WMF is faster and better(quality)…
What’s the difference between these 2 code snippets?


I have observed your comments. I like to inform that both sample codes are almost same except in second sample code you can set borders and background colour. Please share feedback with us if there is still an issue.