Text Is Top-Aligned when Converting SVG to EMF Using Aspose.Slides for Java

Hello Team,

We add SVG based chart as EMF image into PPT Slide after converting the SVG to EMF bytes using the logic mentioned here getBinaryData Method Seems To Do the SVG to EMF Conversion in Java.

Issue: The SVG chart when previewed in browser does render the label vertically center aligned while the EMF image that was converted from SVG using Slides JAVA does not render it vertically center aligned.

Code used for SVG to EMF conversion:

public void convertSvgToEmfUsingSlides() {
    IPresentation pres = PresentationFactory.getInstance().createPresentation();
    try {
        Path svgPath = Paths.get("CircularChart.svg");
        byte[] svgBytes = Files.readAllBytes(svgPath);
        String svgContent = new String(svgBytes, StandardCharsets.UTF_8);

        // Add SVG image to temp slide and extract EMF binary data from it
        IPresentation tempPres = PresentationFactory.getInstance().createPresentation();
        ISvgImage svgImage = new SvgImage(svgContent);
        IPPImage emfImage = tempPres.getImages().addImage(svgImage);
        byte[] emfBytes = emfImage.getBinaryData();

        // Now, add the extracted EMF bytes to original slide
        ISlideCollection slides = pres.getSlides();
        IPPImage ppImage = pres.getImages().addImage(emfBytes);
        slides.get_Item(0).getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0,
                ppImage.getWidth(), ppImage.getHeight(), ppImage);
        pres.save("CircularChart.pptx", SaveFormat.Pptx);
    } catch (Exception e) {
        throw new IllegalStateException(e);
    } finally {
        if (pres != null) pres.dispose();
    }
}

Attached Original SVG, Converted EMF and PPTX files for reference. CircularChart.zip (82.7 KB)

OS: Oracle Linux 7 (x86-64) UEK Release 4
java full version “1.8.0_331-b09”

@oraspose,
Thank you for reporting on the issue. I’ve reproduced the problem with wrong-aligned text when importing the SVG image as an EMF image to a PowerPoint presentation.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39289

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@andrey.potapov Thank you for the quick response and for logging a ticket. We will monitor this thread for any updates.

@oraspose,
Thank you for using Aspose.Slides. Our developers will do their best to resolve the issue.

Hello Team,

Any update on this ticket? As the status says “Blocked”.

@oraspose,
The issue has been blocked by the same issue in .NET version of Aspose.Slides. The issue is still open. Unfortunately, I don’t have any additional information yet. We apologize for any inconvenience.

The issues you found earlier (filed as SLIDESJAVA-39289) have been fixed in Aspose.Slides for Java 24.12 (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.