Convert PowerPoint to PDF in UWP

12 Oct 20235 minutes to read

Syncfusion PowerPoint is a UWP PowerPoint library used to create, read, edit and convert PowerPoint presentation programmatically without Microsoft PowerPoint or interop dependencies. Using this library, you can convert a PowerPoint to PDF in UWP.

Steps to convert PowerPoint to PDF programmatically

Step 1: Create a new C# UWP application project.

Create UWP project

Step 2: Install the Syncfusion.PresentationRenderer.Net.Core NuGet package as reference to your .NET Standard applications from

Install Syncfusion.PresentationRenderer.Net.Core Nuget Package


Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to add “Syncfusion.Licensing” assembly reference and include a license key in your projects. Please refer to this link to know about registering Syncfusion license key in your application to use our components.

Step 3: Add a new button in the MainPage.xaml as shown below.

    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <Button x:Name="button" Content="Convert PPTX to PDF" Click="OnButtonClicked" HorizontalAlignment="Center" VerticalAlignment="Center"/>

Step 4: Include the following namespaces in the MainPage.xaml.cs file.

using Syncfusion.Pdf;
using Syncfusion.Presentation;
using Syncfusion.PresentationRenderer;

Step 5: Include the below code snippet in the click event of the button in MainPage.xaml.cs, to convert the PowerPoint to PDF and save the PDF document as a physical file and open the file for viewing.

//"App" is the class of Portable project.
Assembly assembly = typeof(App).GetTypeInfo().Assembly;

//Open an existing PowerPoint presentation.
using (IPresentation pptxDoc = Presentation.Open(assembly.GetManifestResourceStream("Convert_PowerPoint_Presentation_to_PDF.Assets.Input.pptx")))
    //Convert the PowerPoint presentation to PDF document.
    using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
        // Create a MemoryStream to hold the PDF data.
        MemoryStream pdfStream = new MemoryStream();

        //Save the PDF file.

Save PDF document in UWP

StorageFile stFile;
if (!(Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")))
    FileSavePicker savePicker = new FileSavePicker();
    savePicker.DefaultFileExtension = ".pdf";
    savePicker.SuggestedFileName = "Sample";
    savePicker.FileTypeChoices.Add("Adobe PDF Document", new List<string>() { ".pdf" });
    stFile = await savePicker.PickSaveFileAsync();
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    stFile = await local.CreateFileAsync("Sample.pdf", CreationCollisionOption.ReplaceExisting);
if (stFile != null)
    Windows.Storage.Streams.IRandomAccessStream fileStream = await stFile.OpenAsync(FileAccessMode.ReadWrite);
    Stream st = fileStream.AsStreamForWrite();
    st.Write((outputStream as MemoryStream).ToArray(), 0, (int)outputStream.Length);
    MessageDialog msgDialog = new MessageDialog("Do you want to view the Document?", "File created.");
    UICommand yesCmd = new UICommand("Yes");
    UICommand noCmd = new UICommand("No");
    IUICommand cmd = await msgDialog.ShowAsync();
    if (cmd == yesCmd)
        // Launch the retrieved file
        bool success = await Windows.System.Launcher.LaunchFileAsync(stFile);

You can download a complete working sample from GitHub.

By executing the program, you will get the PDF as follows.

Converted PDF from PowerPoint in UWP

Click here to explore the rich set of Syncfusion PowerPoint Library (Presentation) features.

An online sample link to convert PowerPoint Presentation to PDF in ASP.NET Core.