We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Open/Create presentation in Azure function

Hi all,

I'm trying to build a processing pipeline using Azure Logic App.

When a form response is received it will trigger an Azure function that will create a PPTX.

The function copies a template pptx to a memory stream from Azure storage blob, makes modifications, and then uploads the stream back to the blob.
However, I am running into issues opening the presentation from the stream.

Any Ideas?

            blob = container.GetBlockBlobReference("template.pptx");

            Stream inStream = new MemoryStream();

            blob.DownloadToStream(inStream);

            using (IPresentation pptxDoc = Presentation.Open(inStream))
            {
                /* Make modifications here */
               
                pptxDoc.Save(inStream);

                blob.UploadFromStream(inStream);
                return new HttpResponseMessage(HttpStatusCode.OK);
            }

3 Replies

KC Karthikeyan Chandrasekar Syncfusion Team December 31, 2018 10:28 AM UTC

Hi Frank, 
We suspect different version of “Syncfusion.Licensing” assembly is referred in Azure Function sample, which gives error on runtime while opening or creating the Presentation using our Syncfusion Presentation library. Could you please ensure whether below referred assemblies are in same version?   
Syncfusion.Presentation 
Syncfusion.OfficeChart 
Syncfusion.Compression 
Syncfusion.Licensing 

Still if you are facing same error, please send us the stack trace of the error. So that we can proceed further in this and provide you a solution. 
Regards, 
Karthikeyan  



FS Frank Sposaro December 31, 2018 06:55 PM UTC

You are correct. I dug deeper through the logs and found this error:

"Could not load file or assembly 'Syncfusion.Licensing, Version=16.4450.0.44, Culture=neutral, PublicKeyToken=123...321' or one of its dependencies. The system cannot find the file specified.

Please see the Sync Fusion versions I am using below. How can I get around this issue, which version should I be using? I double checked and there wasn't a nuget update for this.




KC Karthikeyan Chandrasekar Syncfusion Team January 2, 2019 08:33 AM UTC

Hi Frank, 
Syncfusion.Presentation.AspNet.Mvc5 NuGet is compatible only with MVC application which is targeting framework 4.5. So if your application framework is different than 4.5 you should use the Syncfusion.Presentation.WinForms NuGet which will be compatible in 2.0, 3.0, 4.5, 4.5.1 and 4.6 frameworks.

By installing Syncfusion.Presentation.WinForms NuGet in your Azure Function application instead of Syncfusion.Presentation.AspNet.Mvc5 NuGet, you can resolve this issue.

Please let me know if you have any questions. 
Regards, 
Karthikeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon