Dear,
We are not getting the expected output of WMF to PNG conversion within ourimage39.zip (195.1 KB)
Linux environment.
I’ve attached wmf and converted png files, you will get issues there by comparing wmf image39.wmf and converted png file image39.png.
We were trying to follow Aspose.Imaging WMF To Png conversion not properly with no success.
Our Env:
Ubuntu Linux 18.04.4 LTS (GNU/Linux 5.4.0-1029-aws x86_64), running non root account
Microsoft Fonts installed
Licensed Aspose.Images (latest)
Code:
public byte[] convertWmfImage(byte[] input) {
Image img = Image.load(new ByteArrayInputStream(input));
ByteArrayOutputStream os = new ByteArrayOutputStream();
PngOptions pngOptions = new PngOptions();
VectorRasterizationOptions rasterizationOptions = new WmfRasterizationOptions();
rasterizationOptions.setPageWidth(img.getWidth());
rasterizationOptions.setPageHeight(img.getHeight());
pngOptions.setVectorRasterizationOptions(rasterizationOptions);
pngOptions.setCompressionLevel(0);
img.save(os, pngOptions);
return os.toByteArray();
}