PPTX Presentations in C#

Merge and Combine PowerPoint PPT/PPTX Presentations in C#

As a C#.Net developer, you may need to merge multiple PPT or PPTX files into one programmatically. There are many reasons why you might want to merge or combine multiple PowerPoint presentations. For example, to create a presentation that includes information from multiple sources or presentations that contain related information. Merging or combining multiple PowerPoint presentations can help you create better and more consistent presentations. In this article, I will show you how to merge and combine PowerPoint PPT/PPTX presentations in C#.

This article will go over the following topics:

C# REST API to Merge PowerPoint PPTs and SDK Installation

In order to merge PowerPoint files, I will be using .NET SDK of GroupDocs.Merger Cloud API. It is a secure, reliable and high-performance Cloud SDK to merge several documents into one and to split a single file into multiple documents. It also offers functionality to reorder or replace document pages, change pages orientation, manage document passwords and perform other manipulations easily for any supported file format. Currently, it supports Java, PHP, Ruby, Android, and Node.js SDKs as its document merger family members for the Cloud API.

You can install GroupDocs.Merger-Cloud to your Visual Studio project from the NuGet Package manager or using the following command in the .NET CLI:

dotnet add package GroupDocs.Merger-Cloud --version 22.5.0

Next, get your Client ID and Client Secret from the dashboard before you start following the steps and available code examples. Add Client ID and Client Secret in the code as demonstrated below:

Merge Multiple PPT or PPTX Files into One in C# using REST API

You can combine two or more PowerPoint files or merge specific slides of PPTX by following the simple steps mentioned below:

  • Upload the PPTX files to the Cloud
  • Merge the uploaded PPT or PPTX files
  • Download the merged slides

Upload the PowerPoint File

Firstly, upload the PowerPoint PPTX documents to the Cloud using any of the following methods:

  • Using the dashboard
  • Upload all files one by one using Upload File API from the browser
  • Upload programmatically using the code example given below:

As the result, PowerPoint PPTX file will be uploaded to the Cloud Storage.

Combine Multiple PowerPoint PPTX into One

Now, you can merge multiple PowerPoint files programmatically on the cloud. It is a secure and fast way to merge multiple PPTX documents into a single file programmatically by following the steps mentioned below:

  • Firstly, Create an instance of the DocumentApi
  • Secondly, create an instance of the JoinItem
  • Thirdly, set the input file path for the first JoinItem in the FileInfo
  • Then, create a new instance of the JoinItem for the second PPTX presentation
  • Provide the input file path for the second JoinItem in the FileInfo
  • You can add more JoinItems to merge more PPTX files
  • Next, create an instance of the JoinOptions
  • Add a comma-separated list of created join items
  • Also set the output file path on the cloud
  • Now, create an instance of the JoinRequest with join options as a parameter
  • Lastly, get results by calling the join() method of the DocumentApi with JoinRequest

The following code snippet shows how to merge multiple PowerPoint files in C# using REST API:

Input Files

You can see the input PowerPoint files in the image below:

How to merge PowerPoint presentations online

Merge two power point presentations

Output File

You can see the output in the image below:

How to merge multiple PPT files into one in C#

Combine Multiple PowerPoint Presentations into One

Download the Merged File

The above code example will save the merged PPTX file on the cloud. You can download it using the following code snippet:

How to Merge Specific Slides of Multiple PowerPoint Files using C#

You can easily combine specific pages from multiple PowerPoint slides into a single file programmatically by following the steps mentioned below:

  • Firstly, create an instance of the DocumentApi
  • Secondly, create an instance of the JoinItem
  • Set the input file path for the first JoinItem in the FileInfo
  • Now, define a list of page numbers to be merged
  • Next, create another instance of the JoinItem class
  • Set the input file path for the second JoinItem in the FileInfo
  • Define the start page number and end page number
  • Now, define the page range mode as OddPages
  • Create an instance of the JoinOptions
  • Add a comma-separated list of created join items
  • Next, set the output file path on the cloud
  • Then, create an instance of the JoinRequest with JoinOptions
  • Finally, merge slides by calling the join() method of the DocumentApi with JoinRequest

The following code snippet shows how to merge specific pages from multiple PowerPoint files using REST API in C#:

How to Combine PowerPoint Presentations in C# using Slides Range

You can combine multiple PowerPoint slides into one file using slides range mode programmatically by following the steps mentioned below:

  • Firstly, create an instance of the DocumentApi
  • Secondly, create an instance of the JoinItem
  • Set the input file path for the first JoinItem in the FileInfo
  • Next create another instance of the JoinItem
  • Set the input file path for the second JoinItem in the FileInfo
  • Define the start page number and end page number
  • Define the page range mode as OddPages
  • Now, create an instance of the JoinOptions
  • Add a comma-separated list of created join items
  • Next, set the output file path on the cloud
  • Create an instance of the JoinRequest with JoinOptions
  • Finally, combine presentations by calling the join() method of the DocumentApi with JoinRequest

The following code snippet shows how to merge multiple PowerPoint presentations with page range in C# using REST API:

Online Combine PowerPoint Presentations

How to merge PowerPoint files into one online free? Please try the following free online PPTX Merger application to combine multiple PowerPoint presentations into a single file from any device.

Summing up

We are ending this article here. In this blog post, we have learned:

  • how to combine multiple PowerPoint files on the cloud;
  • programmatically upload the PowerPoint file and then download the merged PPTX file from the cloud;
  • how to combine specific pages of multiple PowerPoint files into a single file;
  • how to combine a range of pages of multiple PowerPoint files into one file;
  • and online merge PowerPoint presentations for free.

Additionally, you can learn more about GroupDocs.Merge Cloud API using the documentation. We also provide an API Reference section that lets you visualize and interact with our APIs directly through the browser. Complete source code of GroupDocs.Merger Cloud SDK for .Net is freely available on the GitHub.

Further, groupdocs.cloud is writing other blog posts on new topics. Please stay in touch with us for latest updates.

Ask a question

For any queries about how to combine multiple PPT or PPTX files, please feel free to ask in Free Support Forum.

FAQ

  • How to merge PPT files into one in C#?

Please follow this link to learn the C# code snippet for how to merge PowerPoint slides from different files quickly and easily.

  • How to combine several PowerPoint files into one quickly using REST API?

Create an instance of DocumentApi, set the input files path, create JoinOptions instance and invoke the documentApi.Join() method with JoinRequest to automatically merge PowerPoint files quickly.

  • How to install online PPT merger library?

You can download and install PPT merger API to process, and merge PowerPoint presentations programmatically.

  • How to merge PowerPoint slides online for free?

Please visit PPT merger free to merge and combine two or more PowerPoint files online quickly, in seconds.

  • How to combine multiple PowerPoint PPTs into one online for free?

Open our online PPTX merger
Click inside the file drop area to upload PowerPoint files or drag & drop PowerPoint files.
Click on Merge Now button, PPT merger app will combine all PowerPoint files into one.
The download link of the output file will be available instantly after merging PPT files online.

  • How to merge PowerPoint presentations on Windows?

Please visit this link to merge PPT free. This free PPT merger app will merge PPT together in windows with a single click.

How to combine multiple PPTX into one

How to merge PPT slides without changing format

See Also