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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create a PowerPoint document using Azure function

Platform: ASP.NET MVC |
Control: Presentation |
Published Date: December 21, 2018 |
Last Revised Date: February 1, 2019

You can create, edit, and convert the PowerPoint files without Microsoft Office dependencies in .NET Azure functions using the Syncfusion PowerPoint library.

Steps to modify the template PowerPoint document in Azure functions using Syncfusion Presentation library:

  1. Create a new Azure function project.

  1. Select framework Azure Functions v1 (.NET Framework) and select HTTP trigger as follows.

  1. Install the Syncfusion.Presentation.WinForms NuGet package as a reference to your .NET Framework applications from NuGet.org.

 

 

 

  1. Include the following namespaces in Function1.cs file.

 

  1. Add the following code snippet in Run method of Function1 class to modify the template PowerPoint document in Azure functions and return the modified document to client end.

 

 

  1. Add the following code snippet in Function1 class to add a paragraph within the PowerPoint shape

 

  1. Right-click the project and select Publish. Then, create a new profile in the Publish Window.

Publish window screenshot

  1. Create an App service using Azure subscription and select a hosting plan.

App Service screeenshot

The Syncfusion PowerPoint library works from basic hosting plan (B1). So, select the required hosting plan. It does not work if the hosting plan is Consumption.

Configure hosting plan

  1. After creating the profile, click the Publish button.

Publish screenshot

  1. Now, go to Azure portal and select the App Services. After running the service, click Get function URL by copying it. Then, paste it in the below client sample (which will request the Azure Function, to modify the PowerPoint document with input template document). You will get the modified PowerPoint document as follows.

 

 

A complete Azure function sample can be downloaded from Create PowerPoint file using Azure Function.zip

Steps to post the request to Azure function with template PowerPoint document:

  1. Create a simple console application to request the Azure function API.
  2. Add the following code snippet into Main method to request the Azure function with template PowerPoint document and get the modified PowerPoint document.

 

A console application can be downloaded from ClientApp.zip

Take a moment to peruse the documentation, where you will find other options like create and edit PowerPoint tables, create and edit PowerPoint charts, convert PowerPoint slides to images, and convert PowerPoint file to PDF with code examples.

See Also:

Create a PowerPoint file in Windows Forms

Create a PowerPoint file in WPF

Create a PowerPoint file in UWP

Create a PowerPoint file in Xamarin

Create a PowerPoint file in ASP.NET Core

 

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Frank Sposaro
Dec 28, 2018
I'm trying to copy the ppt template from blob storage, modify the pptx, and then write it back to blob storage.

However, every time I try calling Presentation.Open(myMemoryStream) I'm getting an error.
I've also just tried creating a presentation also and that give errors, which prompted me to use Azure storage.

Any ideas?
Reply
Karthikeyan Chandrasekar [Syncfusion]
Jan 02, 2019
The discussion about @Frank comment could be found in the below link.

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile