There is another issue when I converting WMF image to PNG. After I load the wmf image I noticed that the image Height value is a negative number and it will throw an exception.
I can use the Math.Abs function for a quick fix but I think this is not the expected behavior. Am I right?
Aspose.Imaging.CoreExceptions.ImageSaveException: Image saving failed.
---> Aspose.Imaging.CoreExceptions.ImageSaveException: Image export failed.
---> System.ArgumentOutOfRangeException: Page size incorrect. Please specify positive values for WmfRasterizationOptions.PageWidth and WmfRasterizationOptions.PageHeight. (Parameter 'options')
at (VectorRasterizationOptions )
at .[T](VectorRasterizationOptions )
at .(Object )
at .(Object )
at .(MethodBase , Boolean )
at . ( , )
at .()
at .(Boolean )
at .(Object )
at .(Object )
at .()
at .(Object , UInt32 )
at .(Boolean )
at .(Object[] , Type[] , Type[] , Object[])
at .(Stream , String , Object[] , Type[], Type[] , Object[] )
at .(Stream , String , Object[] )
at (VectorRasterizationOptions , Rectangle )
at Aspose.Imaging.FileFormats.Wmf.WmfImage.kdpagfj68j63c55yfyctsx59qssnqmta (ImageOptionsBase , , Rectangle )
at .(VectorImage , ImageOptionsBase , Rectangle )
at . ( , Image , Stream , ImageOptionsBase, Rectangle , Rectangle )
at .Export(Image , Stream , ImageOptionsBase , Rectangle)
at Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
--- End of inner exception stack trace ---
at Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
at Aspose.Imaging.Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
--- End of inner exception stack trace ---
at Aspose.Imaging.Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
at Aspose.Imaging.Image.Save(String filePath, ImageOptionsBase options)
Project:
ProcessPresentationImages.zip (2.5 KB)
Sample file:
embeddedOleObjects.zip (991.1 KB)