We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Shape Imported from SVG to PowerPoint Presentation Has Wrong Line Width

Hello - I am seeing an issue exporting a Presentation with an SVG imbedded.

This is likely related to SLIDESNET-43450. I can confirm running Python Aspose.Slides via .Net 22.12.0

In the example below, modeled after https://docs.aspose.com/slides/python-net/image/#converting-svg-to-a-set-of-shapes, the returned deck is a black square.

My use-case is to render as a PNG. However, when exporting as a PPTX, the shapes appear to be extremely enlarged and on-top-of another.

image.png (1.8 KB)

import aspose.slides as slides
import aspose.pydrawing as drawing

with slides.Presentation() as presentation:
    # Read SVG file content
    with open("my-test.svg","rt") as in_file:
        svgContent = in_file.read()
        # Create SvgImage object
        svgImage = slides.SvgImage(svgContent)

        # Get slide size
        slide_size = presentation.slide_size.size

        # Convert SVG image to group of shapes scaling it to slide size
        presentation.slides[0].shapes.add_group_shape(svgImage, 0, 0, slide_size.width, slide_size.height)

    # Save presentation in PPTX format
    presentation.save("presentation_with_shape_svg.pptx", slides.export.SaveFormat.PPTX)
    presentation.slides[0].get_thumbnail(drawing.Size(1920, 1080)).save("test.png", drawing.imaging.ImageFormat.png)

Thank you for contacting support.

Could you please share the my-test.svg file you used with this code example? You can zip the file and upload an archive here.

Assessment-Scope.zip (567 Bytes)

@Andrey_Potapov - Here you go!

Thank you for the sample SVG file. I am checking the problem you described and will get back to you soon.

I’ve reproduced the problem with importing the shapes from the SVG image and added a ticket with ID SLIDESPYNET-74 to our issue-tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when a new release of Aspose.Slides with a fix is published.

Thanks for the update @Andrey_Potapov. Is there an ETA for the patch to be released?

I’ve requested plans for the issue from our development team. We will let you know soon.

1 Like

@Andrey_Potapov - Were you able to get an estimated date for the deployment of a patch for this bug?


I am still waiting for a response from our development team. Thank you for your patience.

The issue has been scheduled for investigation for mid-February. We will inform you of any progress.

The issues you found earlier (filed as SLIDESPYNET-74) have been fixed in Aspose.Slides for Python 23.3 (Windows, Linux, macOS).
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 or PyPI.