We are seeing issue related to file size for EMF to SVG converted file compared to EMF to PNG converted file. Could you please check and let us know.
Code Snippet :
String dataDir = “C:\emf-with-svg-content\”;
Image image = Image.load(dataDir + “image9.emf”, new MetafileLoadOptions(true));
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(dataDir + "image9.svg", new SvgOptions() {
{
setVectorRasterizationOptions(emfRasterizationOptions);
}
});
I have worked with source file and sample code shared by you using Aspose.Imaging 18.9 and generated both format PNG and SVG. I like to share that i don’tResult.zip (1.7 MB)
see much difference in size of both formats. I have also shared my generated output with you for your kind reference. I also like to inform that SVG format is xml, which can not be compressed by the nature of the format.
I have observed your comments. You may use below code snippet to reduce file size of PNG. For SVG like i said in my previous reply SVG format is xml, which can not be compressed by the nature of the format.
image.save(path+ “imagepng.png”, new PngOptions() { FilterType = PngFilterType.Adaptive