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 Download C# DLL to Draw & Process Images | Aspose.Imaging

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)

@samer.el-khatib Thanks for giving this solution. It works. But we find a new problem. With EmfRenderMode.EmfOnly enable,some emf can not be converted correctly.image1.zip (2.3 KB)
Would you please take a look?

Hello, @tldyzem,
We have tested attached image1.zip: it fails to export correctly regardless of EmfRenderMode.

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-6589

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.

What’s about this EMF image5.zip (113.3 KB)
? When we use EmfRenderMode.EmfOnly, it only convert part of the EMF。It is a BUG,or mis usage of this parameter?

@tldyzem,
As concerns the EMF above, it works in default mode as expected: it contains both Emf and EmfPlus records. We will review EmfRenderMode behaviour while resolving the opened ticket.