Converting EMF file to SVG using .net version of Aspose DLLs/APIs

Hi,
Does Aspose support converting EMF to SVG file using .Net version of Aspose’s DLLs or APIs?. If yes, Could you provide the name of DLLs and/or APIs and code snippet for conversion.

Thanks a lot in advance.

Note: I already asked same question in another thread but that’s more into different context. Hence , I created new thread.

@usha.rajt,

I have observed your comments. I have also shared code snippet to help you out in this query. Please try to use Aspose.Imaging latest version for .NET 17.9 on your end. Please share feedback with us if there is still an issue.

public void ExportEmfToSvg()
{
string sourcePath = @“F:\Programming\TEST_DATA\94 Java\Example\tiger.emf”;
string destPath = @“F:\Programming\TEST_DATA\94 Java\Example\tiger.svg”;

using (Image image = Image.Load(sourcePath))
{
    EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
    emfRasterizationOptions.BackgroundColor = Color.White;
    emfRasterizationOptions.PageWidth = image.Width;
    emfRasterizationOptions.PageHeight = image.Height;
    image.Save(destPath, new SvgOptions() { VectorRasterizationOptions = emfRasterizationOptions });
}

}

Hi Adnan,

Thank you for your response. I installed latest Aspose. Imaging (.NET 17.9) library and tried converting EMF to SVG in NET. However, I am getting “Image Saving Failed” error.

Note: I could not attached EMF file directly, hence I zipped it and attached the same.
powerpoint_emf.zip (10.2 KB)
Thanks a lot.
Rajesh

Hi Adnan,

Please find attached code snippet which i use to generate SVG from EMF. I get image failed error.

    Dim sourcePath As String = "C:\EMF\PP\powerpoint_emf.emf"
    Dim destPath As String = "C:\EMF\PP\powerpoint_svg.svg"
    Using image__1 As Aspose.Imaging.Image = Aspose.Imaging.Image.Load(sourcePath)
        Dim emfRasterizationOptions As New Imaging.ImageOptions.EmfRasterizationOptions()
        emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.White
        emfRasterizationOptions.PageWidth = image__1.Width
        emfRasterizationOptions.PageHeight = image__1.Height
        Dim aspose_svgOptions As New Aspose.Imaging.ImageOptions.SvgOptions
        aspose_svgOptions.VectorRasterizationOptions = emfRasterizationOptions
        image__1.Save(destPath, aspose_svgOptions)
    End Using

Thanks in advance.
Regards,
Rajesh

@usha.rajt,

I have worked with source code and files shared by you using Aspose.Imaging for Java 17.9 and have been able to observe the issue. A ticket with ID IMAGINGNET-2612 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.