Hi there,
We are using 18.6(aspose-imaging-18.6-jdk16.jar) imaging jar for converting EMF images to SVG files.
Is there a way to reduce the size of the output file ?
Thanks
Hi there,
We are using 18.6(aspose-imaging-18.6-jdk16.jar) imaging jar for converting EMF images to SVG files.
Is there a way to reduce the size of the output file ?
Thanks
I have observed your comments. Can you please share source files so that we may further investigate to help you out.
@Adnan.Ahmad,
image7.zip (28.3 KB)
EMF file size is 237 KB
SVG file size is 251 KB
Is there a way we could reduce the file size to match EMF file or even lesser than (may be 20 - 30% lesser than) EMF file size
I am using below code snippet.
String dataDir = "C:\\ media\\";
System.out.println("Load start : "+System.currentTimeMillis());
Image image = Image.load(dataDir + "image7.emf", new MetafileLoadOptions(true));
System.out.println("Load end : "+System.currentTimeMillis());
try {
// Create an instance of EmfRasterizationOptions class and set
// different options
System.out.println("Conversion start : "+System.currentTimeMillis());
final EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
//emfRasterizationOptions.setBackgroundColor(Color.getWhite());
emfRasterizationOptions.setPageWidth(image.getWidth());
emfRasterizationOptions.setPageHeight(image.getHeight());
// convert it to SVG format.
image.save(baseDir + file.getName()+".svg", new SvgOptions() {
{
setVectorRasterizationOptions(emfRasterizationOptions);
}
});
} finally {
image.dispose();
System.out.println("Conversion end : "+System.currentTimeMillis());
}
//ExEnd:ConvertEMFtoSVG
I suggest you to please try exploring setting vertical and horizontal resolutions on your end. You may try different values on your end.
SvgOptions opts=new SvgOptions();
ResolutionSetting ressetting=new ResolutionSetting();
ressetting.setHorizontalResolution(100);
ressetting.setVerticalResolution(100);
I have further discussed the requirement internally on our end. Actually, EMF and SVG are vector formats and there is no way to achieve a reduced size exported SVG using API.