Free Support Forum -

Blank image generated while converting EMF to Png (Java)

I tried converting EMF file using aspose imaging using various code examples provided by Aspose forums. But all are exporting empty image. (4.6 KB)

                   String filePath = "C:\\Projects\\gdcp\\Picture1.emf";
		License license = new License();
		EmfMetafileImage metafile = new EmfMetafileImage(filePath);

		metafile.setBackgroundColor(Color.getWhiteSmoke());"C:\\Projects\\gdcp\\Picture1.png", new PngOptions());

Above is one of the sample code, i have tried many other options but none are working.

Kindly help me in fixing this.


I have observed the issue shared by you and an issue with ID IMAGINGJAVA-1312 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Thank you Mudassir. Kindly update whenever you are able to get some information. I am stuck right now and have production release soon.


We will share good news with you as soon as possible.

Hello Mudassir,

Any update on this?


I have verified from our issue tracking system and like to share that issue has just recently been created in our issue tracking system and is pending for investigation at the moment. We request for your patience till the time the issue gets scheduled and resolved.


I request you to please try using following sample code on your end to serve the purpose:

using (Image image = Image.Load("Picture1.emf"))
        new PngOptions()
                VectorRasterizationOptions = new EmfRasterizationOptions()
                                                     PageSize = image.Size

Thank you for the update but still image is coming as blank. Note that the code you provided is .Net code, I wrote compatible java code for the same as below:

String filePath = “C:\Projects\gdcp\Picture1.emf”;
String newFilePath = “C:\Projects\gdcp\Picture1.png”;
String AL = “C:\Projects\gdcp\meta\license\Aspose.Total.Java.lic”;
com.aspose.imaging.License license = new com.aspose.imaging.License();

	Image image = Image.load(filePath);
	PngOptions pngOptions = new PngOptions();
	EmfRasterizationOptions emf = new EmfRasterizationOptions();
	pngOptions.setVectorRasterizationOptions(emf);, pngOptions);


Can you please share generated result along with environment details so that we may further investigate to help you out.