How to Convert PowerPoint to PDF using C#

This quick tutorial explains to you the step-by-step process to convert PowerPoint to PDF using C#. We will use one of the popular document converter APIs for performing document transformation from PPTX to PDF format. Further, the document conversion procedure does not rely on any additional software and can be followed on any common operating systems such as Windows, macOS, and Linux. Moreover, you will find a sample code to show the working of the C# PowerPoint to PDF application.

Steps to Convert PowerPoint to PDF using C#

  1. Install GroupDocs.Conversion for .NET package from the NuGet package manager in the .NET application to convert PowerPoint to PDF
  2. Add a reference to the GroupDocs.Conversion namespace for developing the PowerPoint to PDF conversion functionality
  3. Create an instance of the Converter class for loading the input PowerPoint file
  4. Create an object of the PdfConvertOptions class for defining the convert options for the output PDF file
  5. Finally, call the Convert method to save PowerPoint as PDF on the disk

To create the C# PPT to PDF application, the Converter class allows you to load the PowerPoint file after configuring the document conversion package and including the required namespace. The PdfConvertOptions class enables you to define various properties for customizing the converted PDF file. The Convert method performs the document transformation and stores the output file to the specified path on the disk.

Code to Convert PowerPoint to PDF using C#

The above code snippet shows the implementation of the convert PPTX to PDF in C# capability. This sample code performs the basic document transformation, takes the PPTX file as input, and converts it into PDF format. However, you may enhance this example by customizing the PDF document by setting various properties such as Dpi, Height, Width, Margins, Page Rotation, and many more.

We have discussed the document conversion process to convert PowerPoint to PDF in C# and developed an example for it. Recently, we published an article to change Word document to Image in C#, have a look at how to convert Word document to Image using C# guide for more information.

 English