Error Is Occurring when Adding SVG Image to Slide

Hi Ya,

I am getting below error when deployed to server but it executes perfectly when running locally. It would be great if you guys can let me know where the error might be.

Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: CreatePresentation —> System.ArgumentException: Parameter is not valid.

at System.Drawing.Graphics.GetHdc()

at Aspose.Slides. .(Int32 , Int32 )

at Aspose.Slides. …ctor( , Int32 , Int32 )

at Aspose.Slides. .(String , , Int32 , Int32 )

at Aspose.Slides.ImageCollection.AddFromSvg(String svgContent, IExternalResourceResolver externalResResolver, String baseUri)

at Aspose.Slides.ImageCollection.AddFromSvg(String svgContent)

Many Thanks,

Dheeraj

1 Like

@dheerajvan1206,

I have observed the issue shared by you and request you to please try using latest Aspose.Slides 18.6 on your end. If there is still an issue then please share the working sample code along with source presentation and source SVG to investigate the issue further on our end.

We are having a similar issue as well. Once we deploy to an Azure function in Azure. Works fine on the local emulator.

And we are trying 18.6

Hi Ya,

I am still having the same issue after updating the version to 18.6. This is happening when I deploy code to Azure functions. I am trying to read SVG Content and to insert into the slide. Nothing too complicated. If I run this locally it works fine.

System.ArgumentException: Parameter is not valid.

at System.Drawing.Graphics.GetHdc()

at Aspose.Slides. .(Int32 , Int32 )

at Aspose.Slides. …ctor( , Int32 , Int32 )

at Aspose.Slides. .(String , , Int32 , Int32 )

at Aspose.Slides.ImageCollection.AddFromSvg(String svgContent, IExternalResourceResolver externalResResolver, String baseUri)

at Aspose.Slides.ImageCollection.AddFromSvg(String svgContent)

Many Thanks,

Dheeraj

I guess its GDI+ on the Azure instance. PowerPoint supports native SVGs now so is System.Drawing even required?

@omobonodev,

I have observed the information shared by you and like to share that we have included .NET Core support in latest version. This is major difference between present and previous versions. Can you please try using Aspose.Slides for .NET 18.5 on your end as well and share if things work. In that case please share the working sample project with all necessary information that we may use on our end to investigate the issue.

Hi Mudassir,

I have tried on both the versions but still it is the same error. Please let me know how you want me to share the sample code.

Thanks,

Dheeraj

@dheerajvan1206,

You can share the information in this thread by zipping into a package if size is less than 3 MB. Otherwise, you can host the information on some FTP or dropox server and sharing download link with us.

Hi Mudassir, The code has lot of dependencies… It is an Azure function that will be triggered when a message is received in service bus and gets the SVG content from blob storage. I am not sure if I am allowed to share code.

@dheerajvan1206,

I have crated an issue with ID SLIDESNET-40271 in our issue tracking system to further investigate the issue on our end. We will share the feedback with you as soon as we will complete our investigation.

Hi Mudassir,

Can you please ket me know the status of this issue (SLIDESNET-40271)?

Thanks,

Dheeraj

Can you add me to this Issue tracking as I am having the same problem.
M

@dheerajvan1206 / @omobonodev,

The issue has just recently been added in our issue tracking system and os pending for investigation in issues queue. We shall be scheduling and investigating the issue on its due turn and will then be able to share feedback with you. We request for your patience till the time we schedule and investigate the issue.

Hi Mudassir,

Can you let us know the status of this issue please?

Many Thanks,

Dheeraj

@dheerajvan1206,

I have verified from our issue tracking system and like to share that the issue has just recently been created and is waiting for investigation in issues queue. I request for your patience till the time the issue is scheduled for investigation and resolution on its due turn. We will update you as soon as the issue will be fixed.

@dheerajvan1206,

We have initiated issue investigation on our end and request you to please share information about your Azure virtual machine details (this can be done using PowerShell commands likse Get-AzureOSVersion - https://docs.microsoft.com/en-us/powershell/module/servicemanagement/azure.service/get-azureosversion?view=azuresmps-4.0.0). Any other information (like .NET Core version) will be very usefull, too.

Hi Mudassir,

It is being executed as an Azure function which is serverless. All the code is developed using .net framework 461.

Thanks,

Dheeraj

@dheerajvan1206,

Thank you for sharing the information. We will share feedback with you as soon as we will complete investigation.

Is there any update ?