Hello again.
We recently noticed that in-memory conversion of image using getBinaryData() API allows the SVG images to be saved in EMF format . For example:
final IPPImage imgx;
if (isSVGimage() ) {
ISvgImage svgImage = new SvgImage(imagebytes);
IPPImage tmpImage = pptx.getImages().addImage(svgImage);
// Note that getBinaryData seems to do the SVG to EMF conversion
imagebytes = tmpImage.getBinaryData();
imgx = pptx.getImages().addImage(imagebytes);
}
Is this supported behaviour and expected to be in all the subsequent releases of Aspose.Slides?
@oraspose,
I need some time to check the issue you described. We will reply to you as soon as possible.
@oraspose,
I’ve reproduced the converting SVG images to EMF and added a ticket with ID SLIDESJAVA-38936 to our issue tracking system. We apologize for any inconvenience. We will answer your question soon.
@oraspose,
Our developers have investigated the issue. We cannot currently guarantee that this will not change in the future. But we can add a method for such a conversion which will not change in the future.
Hello Andrey,
Thanks very much for a quick response.
Please do let us know, when a new method for SVG -> EMF conversion will be added to the product.
@oraspose,
I’ve added a ticket with ID SLIDESJAVA-38941 to our issue tracking system. Our development team will consider implementing such a method. You will be notified when a new release of Aspose.Slides with this feature is published.
Hello.
Kindly please advise on the status of the SLIDESJAVA-38941 ---- Status : Blocked
Is there a plan to unblock this ? If so - what is the timeline / schedule of fixing this issue?
Also the same inquiry for ID SLIDESJAVA-38955 - [Issue with Presenting Charts in SVG Format in PowerPoint Presentation] (Issue with Presenting Charts in SVG Format in PowerPoint Presentation)
@oraspose,
The issues have been blocked by similar issues in Aspose.Slides for .NET. I’ve requested plans for the issues from our developers. We will let you know them soon.
@oraspose,
The issue SLIDESJAVA-38955 was postponed due to other priority issues. The issue SLIDESJAVA-38941 has been planned to be fixed in Aspose.Slides 23.2.
Has this issue been resolved in Aspose.Slides 23.2? If not - is there an ETA ?
Thank you.
@oraspose,
As far as I can see, the issue has been moved to fix in Aspose.Slides 22.4. We apologize for any inconvenience.
@oraspose,
A new method writeAsEmf(Stream stream) will be added in Aspose.Slides for Java 25.1. The code example below shows you how to use it.
Presentation presentation = new Presentation();
// Create a new SVG image.
byte[] svgBytes = Files.readAllBytes(Paths.get("content.svg"));
ISvgImage svgImage = new SvgImage(new String(svgBytes, StandardCharsets.UTF_8));
// Save the SVG image as a metafile.
ByteArrayOutputStream memStream = new ByteArrayOutputStream();
svgImage.writeAsEmf(memStream);
// Add the metafile to the image collection.
presentation.getImages().addImage(memStream.toByteArray());
presentation.dispose();
The issues you found earlier (filed as SLIDESJAVA-38941) have been fixed in Aspose.Slides for Java 25.1 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
Thank you, Andrey, we will try out this new API.
@oraspose,
Thank you for using Aspose.Slides for Java.