This quick tutorial describes how to create PowerPoint slides in HTML using C# with the help of simple to-do steps and a runnable sample code. You can create a new presentation and save it as HTML or convert an existing presentation to HTML for displaying it in a browser. You can create an HTML presentation with C# without installing MS PowerPoint or any other third-party tool.
Steps to Create PowerPoint Slides in HTML using C#
- Configure the project to install Aspose.Slides for .NET using the NuGet package manager
- Create an empty PowerPoint presentation using the Presentation class object
- Get a reference to the first default slide in the newly created presentation
- Insert a rectangle type auto shape
- Save the resultant presentation as an HTML file
These steps guide to create HTML presentation slides using C# with the help of a few API calls only. You can create a new presentation or load an existing presentation to convert to HTML. Here we have just created a rectangle type auto-shape to show the contents on the HTML page for clarity.
Code to Create HTML Presentation using C#
This code to render PowerPoint slides in HTML using C# has added an auto-shape however you can add hyperlinks, media files, text paragraphs, bullets, numbered lists, charts, shapes, smart art, etc. Similarly, while saving the output HTML, you can select the slides that you want to render to HTML along with the option to save it to a memory stream also.
In this tutorial, we have learned to convert presentation to HTML using C#. If you want to learn to add some watermark in a presentation, refer to the article on how to add image watermark in PPTX presentation using C#.