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

Free Support Forum - aspose.com

Emf picture convert to png fail

below emf file convert to png use java api failed and the png file is messedimage1.emf.zip (11.1 KB)
up

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

  Issue ID(s): IMAGINGNET-6070

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks,we have old version payed, could we get a hotfix based on that version for this problem, or we need to payed for latest version or some other types of services to upgrade and get the hotfix?

Hello, @tldyzem,
The fixes are delivered with the latest release, so getting a hotfix requires having license which covers the possible release date.

@tldyzem, for correct rendering of this image, please use the code below

using var image = Image.Load("image1.emf");
var options = new PngOptions()
{
    VectorRasterizationOptions = new EmfRasterizationOptions()
    {
        PageWidth = image.Width,
        PageHeight = image.Height,
        RenderMode = EmfRenderMode.EmfOnly
    }
};
image.Save("image1.emf-EmfOnly.png", options);

Thanks, could you please provide the release version which contains the fix?

Does the code only valid on latest release with the current fix or generally use for all emf image conversion cases?

I do not see the version update on the download page, how could we get the latest release, thanks?

@tldyzem, Latest available version of Aspose.Imaging is 22.12 and can be found at download page https://releases.aspose.com/imaging/net/

Thanks,I tried this one, but this is the release at the end of 2022 and does not contain the fix for the emf 2 png issue.
I mean which release we could get the fix for the reported emp2png problem? thanks for answering

@tldyzem, your issue can be fixed using next code to save image

using var image = Image.Load("image1.emf");
var options = new PngOptions()
{
    VectorRasterizationOptions = new EmfRasterizationOptions()
    {
        PageWidth = image.Width,
        PageHeight = image.Height,
        RenderMode = EmfRenderMode.EmfOnly
    }
};
image.Save("image1.emf-EmfOnly.png", options);

This code was checked on Aspose.Imaging 22.11,22.12 and provides correct result which is attached.image1.emf-EmfOnly.png (7.9 KB)