XAML (eXtensible Application Markup Language) is an XML based descriptive language that is used to design graphical user interfaces. Especially, XAML is used in WPF (Windows Presentation Foundation), UWP (Universal Windows Platform), and Xamarin Forms. In this article, you will learn how to convert the slides in a PowerPoint presentation to the XAML interfaces programmatically. Particularly, the article will cover PowerPoint PPTX to XAML conversion using C#.
- C# PowerPoint PPT to XAML Converter - Free Download
- Steps to Convert PPT to XAML in C#
- Convert PPTX to XAML in C#
- C# PowerPoint to XAML with Custom Options
C# PowerPoint PPT to XAML Converter - Free Download
In order to convert a PowerPoint PPT or PPTX to XAML, we will use Aspose.Slides for .NET. It is a presentation manipulation API that lets you create, modify or convert PowerPoint presentations. You can either download the API or install it using NuGet.
PM> Install-Package Aspose.Slides.NET
Steps to Convert PPT to XAML in C#
Aspose.Slides for .NET provides the simplest way of converting PowerPoint PPT to XAML in C#. The following steps are required to perform PPT or PPTX to XAML conversion.
- Load the PPT file from disk.
- Save PPT as XAML to desired location.
The following sections demonstrate how to perform the above-mentioned steps and save a PPT as XAML in C#.
Convert PPTX to XAML in C#
The following are the steps to convert slides in a PowerPoint presentation to XAML in C#.
- First, load the PowerPoint presentation using Presentation class.
- Convert presentation to XAML files using Presentation.Save(new XamlOptions()) method.
The following code sample shows how to convert a PowerPoint PPTX to XAML.
// Load the PowerPoint presentation | |
using (Presentation pres = new Presentation("pres.pptx")) | |
{ | |
// Convert presentation to XAML | |
pres.Save(new XamlOptions()); | |
} |
The following is the screenshot of the files we get after performing PPTX to XAML conversion.

C# PowerPoint to XAML - Custom Options
You can also customize the PowerPoint to XAML conversion by setting different options. For example, you can define whether to convert hidden slides or not. The following are the steps to convert PowerPoint presentations to XAML with custom options.
- First, load the PowerPoint presentation using Presentation class.
- Create an instance of XamlOptions class and set XamlOptions.ExportHiddenSlides to true.
- Convert presentation to XAML files using Presentation.Save(XamlOptions) method.
The following code sample shows how to customize PowerPoint to XAML conversion in C#.
// Load the PowerPoint presentation | |
using (Presentation pres = new Presentation("pres.pptx")) | |
{ | |
// Set options | |
XamlOptions options = new XamlOptions(); | |
options.ExportHiddenSlides = true; | |
// Convert presentation to XAML | |
pres.Save(options); | |
} |
Get a Free API License
You can use Aspose.Slides for .NET without evaluation limitations by requesting a temporary license.
Conclusion
In this article, you have learned how to convert PowerPoint PPT or PPTX presentations to XAML using C#. You can simply install the API and integrate the provided code in your .NET applications. In addition, you can visit the documentation to explore other features of Aspose.Slides for .NET. Also, you can feel free to let us know about your queries via our forum.