How to Split PPTX Files in .NET
Step-by-step guide to splitting a PowerPoint (PPTX) presentation into separate presentations using the GroupDocs.Merger.LowCode library for .NET.
Overview
This article explains how to split a PowerPoint (PPTX) presentation into separate presentations using the Split PPTX plugin (SplitPptx) from the GroupDocs.Merger.LowCode package for .NET. GroupDocs Document Merger Plugins are lightweight, single-purpose tools that make merging and splitting documents simple and efficient for .NET developers.
About Document Merger Plugins
GroupDocs Document Merger Plugins are built on our enterprise-grade GroupDocs.Merger SDK. These plugins merge, split, and remove pages in PDF, Word (DOCX), and PowerPoint (PPTX) documents, and are designed for cross-platform use on Windows, macOS, and Linux under .NET 6+. Each plugin offers a lightweight, fixed-price solution for one operation on one format (e.g., Merge PDF), making them ideal for developers who need a simple, focused tool.
Prerequisites
- .NET 6.0 or later
- A license file (
GroupDocs.Merger.LowCode.lic). Without a license, the plugin runs in evaluation mode. - A PPTX file to split
Installation
To install the GroupDocs.Merger.LowCode package, run the following command in your terminal:
dotnet add package GroupDocs.Merger.LowCodeCode Example
The following example puts slides 1, 2, and 3 of source.pptx into separate presentations:
using GroupDocs.Merger.LowCode;// Set your licenseLicense.Set("GroupDocs.Merger.LowCode.lic");// Select slides 1, 2, and 3var splitter = new SplitPptx("source.pptx", new[] { 1, 2, 3 });// Save each of them as a separate presentationsplitter.Save("output/slide.pptx");open GroupDocs.Merger.LowCode// Set your licenseLicense.Set("GroupDocs.Merger.LowCode.lic")// Select slides 1, 2, and 3let splitter = SplitPptx("source.pptx", [| 1; 2; 3 |])// Save each of them as a separate presentationsplitter.Save("output/slide.pptx")Imports GroupDocs.Merger.LowCode' Set your licenseLicense.Set("GroupDocs.Merger.LowCode.lic")' Select slides 1, 2, and 3Dim splitter As New SplitPptx("source.pptx", {1, 2, 3})' Save each of them as a separate presentationsplitter.Save("output/slide.pptx")Output
The plugin writes one presentation per slide and adds the slide number to the file name: output/slide_1.pptx, output/slide_2.pptx, and output/slide_3.pptx. The output folder is created if it doesn’t exist. To control the names, put {0} in the file name, for example output/slide-{0}.pptx; the part number replaces it.
Split a Presentation into Parts
With SplitMode.Interval, the slides you list mark where each new part starts. The following example cuts a presentation before slides 7 and 13: part_0.pptx holds slides 1 to 6, part_1.pptx holds slides 7 to 12, and part_2.pptx holds slides 13 to the end. Interval parts are numbered from 0.
using GroupDocs.Merger.Domain.Options;using GroupDocs.Merger.LowCode;// Start a new part at slides 7 and 13var splitter = new SplitPptx("source.pptx", new[] { 7, 13 }, SplitMode.Interval);// Save one presentation per partsplitter.Save("output/part.pptx");Split a Range of Slides
Pass the first and the last slide of a range to put every slide of the range into a document of its own. Add a RangeMode to keep only the odd or even slides of the range. The following example splits out slides 2, 4, and 6:
using GroupDocs.Merger.Domain.Options;using GroupDocs.Merger.LowCode;// Select the even slides from 1 to 6var splitter = new SplitPptx("source.pptx", 1, 6, RangeMode.EvenPages);// Save one presentation per slidesplitter.Save("output/even.pptx");The source presentation can also be a Stream. For more examples in C#, VB.NET, and F#, see Using SplitPptx to Split PPTX Documents in the documentation.
Licensing
A license is required to use the plugin without evaluation limitations. In evaluation mode, only the first three pages are processed, and an evaluation message is added to every page of the output. Each plugin is licensed separately. You can obtain a free temporary license for testing: