How to Convert Multiple PPT Files to PDF in C#

This quick tutorial guides on how to convert multiple PPT files to PDF in C#. It contains all the steps to configure the environment and develop an application that can convert multiple PPT to one PDF in C# with the help of a few API calls only. You will have control over each slide that is included in the PDF like filtering some slides or setting some other properties if required.

Steps to Convert Multiple PPT Files to PDF in C#

  1. Configure the IDE to use Aspose.Slides for .NET using the NuGet package manager
  2. Create a new presentation and remove its default slide using the Presentation class
  3. Get the list of all the PPT files to be rendered into a single PDF
  4. Iterate through each presentation file and load it into a separate Presentation object
  5. Iterate through all the slides in each presentation and add a clone into the destination presentation
  6. Save the resultant presentation as a PDF containing slides from all the presentations

Here step-by-step instructions are provided to convert multiple PPT files to PDF in C#. Complete logic is described to write a converter where a new presentation is created and then its default slide is also deleted to make it empty, however, you may load an existing presentation having slides in it and then add slides from other presentations to it before saving it as a PDF file.

Code to Convert Multiple PPT to One PDF in C#

This code demonstrates how to convert multiple PPT to PDF in C# by providing the required classes and namespaces list. It is a complete code that contains the logic to read PPT files only from a folder however, you may simplify it by getting the list of file names from some other source and then performing the rest of the tasks as per your requirement. Note that during iteration, when you get access to each slide you may set properties like setting its background, adding some ActiveX control, working with the shapes on the slide, and so on.

We have learnt that while writing PPT to PDF converter multiple files in C# are rendered to a single PDF. If you want to learn the process to secure PPT, refer to the article on how to secure PowerPoint presentation in C#.

 English