In this simple topic, we will demonstrate to you how to convert SVG to Presentation using C# without any reliance on PowerPoint. Good thing is that you do not need third-party software or an Interop library for converting SVG to PPTX in C#. The application can be used in any of the .NET configured environments inside Windows, Linux or macOS provided sample code can run seamlessly on all .NET platforms.
Steps to Export SVG to PPTX in C#
- Configure your application to add Aspose.Slides for .NET package from NuGet.org
- Create an instance of a Presentation class to create a default presentation
- Access the first default slide inside the presentation slides collection
- Read the SVG file content as a string and insert that into the presentation images collection
- Add a picture frame shape inside the selected slide with added SVG image
- Save the presentation with an SVG image on the disk
By using the aforementioned steps in C# saving SVG as PPT presentation can be easily done. The process is commenced by creating an instance of the Presentation class and accessing the default first slide from the slides collection. Then SVG file content is read as a string from the disk and added to an IPPImage inside the presentation images collection. Finally, a picture frame shape is added inside the slide by using the added SVG and the presentation is saved on the disk.
Code to Convert SVG to PPTX in C#
By using the above example in C# SVG to PowerPoint presentation conversion can be easily done using a few lines of easy code. You can also use an existing presentation and may insert the SVG at any position inside any slide by setting any custom size as well. You can also load the source SVG as a memory stream from sources like databases or the web as well.
This tutorial explains how to insert SVG in Presentation using C#. If you want to learn about adding a table inside the PowerPoint presentation, refer to the article on how to create a table in PowerPoint using C#.