XDoc.PowerPoint
Features
Tech Specs
How-to C#
Pricing

C# PowerPoint Library
C# PowerPoint - Split PowerPoint Document in C#.NET


Explain How to Split PowerPoint Document in Visual C#.NET Application



C# PowerPoint document splitting library control, XDoc.PowerPoint, provides an advanced C# programming way to split PowerPoint document into smaller PowerPoint files in .NET developing applications. Using this C#.NET PowerPoint document splitting library control, C# developers can easily and accurately disassemble multi-page PowerPoint document into two or more separate PowerPoint document files by page(s).

RasterEdge Visual C# .NET PowerPoint document splitter control toolkit SDK can not only offer C# developers a professional .NET solution to split PowerPoint document file but also provide them the ability to name outputted PowerPoint document files with a customized name pattern using a few lines of simple Visual C# code.

This C#.NET PowerPoint document splitting library control offers developers an efficient PowerPoint document splitting approach, using which C# developers can split target PowerPoint document file by specifying a page or pages. If needed, developers can also combine generated split PowerPoint document files with other PowerPoint files to form a new PowerPoint file using RasterEdge XDoc.PowerPoint. Besides, in the process of splitting PowerPoint document, developers can also remove certain PowerPoint page from target PowerPoint file using C#.NET PowerPoint page deletion API.

Please note, PowerPoint file will be divided from the previous page of your defined page number which starts from 0. For example, your original PowerPoint file contains 4 pages. If your page number is set as 1, then the two output PowerPoint files will contains the first page and the later three pages respectively.


How to split Microsoft Office PowerPoint document using C#?

  1. Download XDoc.PowerPoint C# PPTX document library
  2. Install C# PPTX library to split Microsoft PowerPoint file in .NET applications
  3. Step by Step Tutorial












Split PowerPoint file into two files in C#

This is an C# example of splitting a PowerPoint file into multiple ones by number of pages.

String inputFilePath = Program.RootPath + "\\" + "1.pptx";
String outputFilePath1 = Program.RootPath + "\\" + "Split1.pptx";
String outputFilePath2 = Program.RootPath + "\\" + "Split2.pptx";
String[] outputOps = new  String[] { outputFilePath1, outputFilePath2 };
//  split a PowerPoint file with options
PPTXDocument.SplitDocument(inputFilePath, 2, outputOps);


Split PowerPoint Document into Multiple PowerPoint Files in C#

You can use the following C# demo to split PowerPoint document to four files.

String inputFilePath = Program.RootPath + "\\" + "1.pptx";
String outputFileName = "Output.pptx";
int[] splitIndex = new int[3] { 1, 3, 5 }; // Valid value for each index: 1 to (Page Count - 1).

// Create output PowerPoint file path list
List<String> outputFilePaths = new List<String>();
for (int i = 0; i <= splitIndex.Length; i++)
{
        outputFilePaths.Add(Program.RootPath + "\\" + outputFileName + "_" + i.ToString() + ".pptx");
}

// Split input PowerPoint file to 4 files:
// File 0: page 0.
// File 1: page 1 ~ 2.
// File 2: page 3 ~ 4.
// File 3: page 5 ~ the last page.
PPTXDocument.SplitDocument(inputFilePath, splitIndex, outputFilePaths.ToArray());