Adding SVG to ppt is throwing error on Ubuntu


#1

Hi.

I’m getting an error when inserting svg into ppt on Ubuntu using .Net Core.

using (Presentation presentation = new Presentation())
{
var svgContent = System.IO.File.ReadAllText("/root/test.svg");

           ISvgImage svgImage = new SvgImage(svgContent);
           var emfImage = presentation.Images.AddImage(svgImage);
           presentation.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, emfImage.Width, emfImage.Height, emfImage);
            presentation.Save("test.pdf", Aspose.Slides.Export.SaveFormat.Pdf);
        }

The error is attached as an image. The same code works fine in Windows.

Unhandled Exception: System.ArgumentException: Parameter is not valid.
at System.Drawing.Image.CreateFromHandle(IntPtr handle)
at System.Drawing.Image.LoadFromStream(Stream stream, Boolean keepAlive)
at Aspose.Slides.PPImage.()
at Aspose.Slides.PPImage.get_Width()

image.png (5.4 KB)


#2

@ashiramin,

Can you please share source presentation so that we may further investigate to help you out. Also please share environment details with us.


#3

@Adnan.Ahmad

I’m running this on Ubuntu 18.04 with .net core 2.1 and latest version of aspose slides. As for the presentation I initialize a new presentation object.

Let me know if you have additional questions.

Thanks


#4

@ashiramin,

Can you please share source svg image along with which Aspose.Slides version you are using on your end.


#5

I used 19.7 Aspose slides. Attaching the sample svg file. Though I’ve tried it with random svg images found online and got the same error.

test.svg.zip (2.2 KB)


#6

@ashiramin,

I have worked with source file and have been able to observe issue. A ticket with ID SLIDESNET-41367 has been created in our issue tracking system to further investigate to resolve the issue. We will share good news with you soon.


#7

When can I expect it to be resolved?


#8

@ashiramin,

I like to inform that we will share ETA after detail investigation. I request for your patience.