Guide for C#
Core Document Formats
Additional Features

C# PowerPoint - Merge or Split PowerPoint

Combine and Split PowerPoint Documents, C#.NET PowerPoint Processing SDK

Visual C#
Home > .NET Imaging SDK > C# > PowerPoint: Merge or Split
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

PowerPoint File Merging and Spliting in C#
PowerPoint Document Merger of RasterEdge .NET Imaging SDK is a flexible and reliable PowerPoint files combining solution that can be seamlessly incorporated within any C#.NET platform, including C#.NET Windows Forms and C# web ASP.NET projects. Users are entitled with great abilities to use this PowerPoint document merging control to combine two or a list of PowerPoint documents together and create a new PowerPoint file with the merged source or just combine some slides from different PowerPoint files and generate a new one. All these procedures will be finished at high speed under the guide of demo methods and sample codes managed 100% in C# class. Moreover, users also are capable of saving combined PowerPoint document in the form of local file of in memory stream.
Related .net document control helps: mvc display tiff: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control edit pdf page control: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C# edit pdf image control: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C# annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C# dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET image viewer jquery: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery sharepoint document viewer free: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
PowerPoint Document Splitting Component of RasterEdge .NET Imaging SDK is some like PowerPoint file merger in its high performance and reliability. With this PowerPoint splitting tool, users are able to integrate MS PPTX dll within C#.NET project to split and separate the loaded and decoded PPTX document into two small PowerPoint files with the aid of online C# sample code. You also can see combining and splitting PPT document(s) in VB.NET class.
From this PowerPoint document merging and splitting article, users can learn following information:
  • Key features and benefits for using RasterEdge PowerPoint merging and splitting capablities
  • Respective APIs and methods on combining and separating target PowerPoint documents in C#.NET
  • C# sample codes on combining a list of PowerPoint documents and create a new single one
  • C# demo code on splitting a PowerPoint document into two small PowerPoint files
C#.NET PowerPoint Merging and Splitting - Key Features
  • Support MS PowerPoint 2007 and above versions within .NET Framework 2.0 of later versions
  • Offer C# demo APIs and codes for combining two or multiple PowerPoint documents at fast speed
  • Able to select a list of slides from different PowerPoint files to merge in C# class
  • Support creating a complete new PowerPoint document with the combined source document
  • Allow users to store the combined PowerPoint file in two ways: form of file path and memory stream
  • Easy to separate or split the target PowerPoint document into two sub-documents as the page index you defined
C# APIs and Codes to Merge Two or More PowerPoint Files
Two main modules are included in this part: APIs on PowerPoint documents combining and C# demo codes to merge a list of PowerPoint files.

C# APIs on Merging PowerPoint Documents and Saving to File & Stream

Please check following list of C# APIs and methods to combine two or more PPTX documents to create a new document and store it in either the way of a MemoryStream or PowerPoint file (file name ends with .pptx).
void PPTXDocument.Combine(List<BaseDocument> source, Stream destn);
void PPTXDocument.Combine(List<BaseDocument> source, String destn);
void PPTXDocument.Combine( List<String> source, Stream destn);
void PPTXDocument.Combine(List<String> source, String destn);

C# Demo Codes to Combine Slides from Different PowerPoint Files

Please refer to following demo code in C# to select multiple slides from two or more PowerPoint documents to merge a new single file.
/// <summary>
/// Two PowerPoint files are available, and we want combine some pages of document 1 and some pages of document 2 to form a new PPT document
/// </summary>
/// <returns></returns>
public void ExtractPagesToFormNewDocument(String filePath1, String filePath2, List<int> pageList1, List<int> pageList2, String destnPath)
// two temporary string to store the extracted documents file paths
String tmpFilePath1 = @"c:\tmpFile1";
String tmpFilePath2 = @"c:\tmpFile2";

PPTXDocument.ExtractPagesFromDocument(filePath1, pageList1, tmpFilePath1);
PPTXDocument.ExtractPagesFromDocument(filePath2, pageList2, tmpFilePath2);

List<String> docPathList = new List<string>();


PPTXDocument.Combine(docPathList, destnPath);


C# Sample Code to Merge a List of PowerPoint Documents and Save to File

Use C# example code below to merge a list of PowerPoint files into a single one and save the combined file to local file path.
/// <summary>
/// Combine a list of documents into a single one and save it to file
/// </summary>
/// <param name="s"></param>
/// <param name="docList"></param>
public void CombineDocumentAndSaveItToFile(String filePath, List<String> docList)

PPTXDocument.Combine(docList, filePath);


Code in C# to Combine a List of PowerPoint Documents and Save to Stream

Unlike above sample code, users can refer to demo C# code below to merge multiple PowerPoint files into a new one and save it to memory stream in high efficiency.
/// <summary>
/// Combine a list of documents under the folder into a single one and save it to stream
/// </summary>
/// <param name="s"></param>
/// <param name="docList"></param>
public void CombineDocumentsToStream(String combinedPath)
string[] dirs = Directory.GetFiles(@"D:\FontFile2\", "*.pptx");

List<String> docList = new List<string>();

foreach(String doc in dirs)

PPTXDocument.Combine(docList, combinedPath);

C# APIs and Demo Codes on Splitting PowerPoint Document
Like the arrangement of PowerPoint document combining section, we also prepare the C# methods and sample code in this PowerPoint splitting module.

C# Methods to Split PowerPoint Document

Contrary to PowerPoint merging, users also can split a PowerPoint document into two sub-documents based on the input page index.
void PPTXDocument.SplitDocument(Stream source, int index, List<String> destns);
void PPTXDocument.SplitDocument(String source, int index, List<String> destns);
void PPTXDocument.SplitDocument(Stream source, int index, List<Stream> destns);
void PPTXDocument.SplitDocument(int index, String source, List<Stream> destns);

C# Sample Code on Splitting PowerPoint File

Following demo code in C# is offered to help users to work out PowerPoint document splitting. And please note that this example code is for separating PowerPoint file into 2 sub-documents, if you need to split PowerPoint into 4, 6, 8, or more small files, you just need to resplit the seperated PPTX file.
/// <summary>
/// Split a document into 2 sub-ocuments
/// </summary>
/// <param name="originalDocument"></param>
/// <param name="pageIdx"></param>
public void splitPPTXDocument(String sourceFilePath, int pageIdx, List<String> destnsPath)

PPTXDocument.SplitDocument(sourceFilePath, pageIdx, destnsPath);


Recommend this to Google+ is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster