Free Support Forum - aspose.com

EMF to SVG conversion issue


#1

Hi there,

We have observed an issue with converted SVG image (from EMF).

We could see that few of the SVG images contents are actually base64 encoded PNG content and not acutal SVG image contents.

Is it possible to return a flag for these kinds of cases so that we could actually extract a PNG instead of loading the SVG ?

I have attached below two images for your reference.
image6.emf is converted to SVG but the actual contents of the SVG are base64 PNG.
image22.wmf is converted to SVG.

Code Snippet :
String fileName = “image34.emf”;
String baseFolder = “C:\Users\gm69267\Desktop\EMF - issues\”;
String inputFileName = baseFolder + fileName;
String outputFileName = baseFolder + fileName + “.svg”;
Image image = Image.load(inputFileName);
try {
// Create an instance of EmfRasterizationOptions class and set
// different options
final EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.setPageWidth(image.getWidth());
emfRasterizationOptions.setPageHeight(image.getHeight());

// call the save method and pass instance of SvgOptions class to
// convert it to SVG format.
image.save(baseFolder + "image35.svg", new SvgOptions() {
	{
		setVectorRasterizationOptions(emfRasterizationOptions);
		
	}
});

}
finally
{
image.close();
}

EMF - issues.zip (697.9 KB)


#2

@gm69267,

I have worked with source file and sample code shared by you and unable to observe any issue. I have also shared my generated result with you for your kind reference. Can you please share comparison screenshot pointing towards issue so that i may further investigate to help you out. Also please share environment details along with version you are using on your end.image350.zip (647.2 KB)


#3

Hi @Adnan.Ahmad - Please open the generated output file with notepad or textpad. You should be able to see the difference between the two files.

image350.svg content is <image x=“0” y=“0” xlink:href="data:image/png;base64

image22.svg content is <?xml version="1.0" standalone="no"?>

                    <path clip-rule="evenodd" d="M-4194304 -4194304L4194304 -4194304L4194304 4194304L-4194304 4194304z" />                    </clipPath>
                <clipPath  id="2">

#4

@gm69267,

I have worked with the SVG files shared by you and have been able to observe the issue shared. An issue with ID IMAGINGNET-3249 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.