Overview
This article explains how to split a PDF document into separate PDF files using the Split PDF plugin (SplitPdf) 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 PDF file to split
Installation
To install the GroupDocs.Merger.LowCode package, run the following command in your terminal:
dotnet add package GroupDocs.Merger.LowCode
Code Example
The following example puts pages 1, 2, and 3 of source.pdf into separate documents:
using GroupDocs.Merger.LowCode;
// Set your license
License.Set("GroupDocs.Merger.LowCode.lic");
// Select pages 1, 2, and 3
var splitter = new SplitPdf("source.pdf", new[] { 1, 2, 3 });
// Save each of them as a separate PDF
splitter.Save("output/page.pdf");
VB.NET Example
Imports GroupDocs.Merger.LowCode
' Set your license
License.Set("GroupDocs.Merger.LowCode.lic")
' Select pages 1, 2, and 3
Dim splitter As New SplitPdf("source.pdf", {1, 2, 3})
' Save each of them as a separate PDF
splitter.Save("output/page.pdf")
F# Example
open GroupDocs.Merger.LowCode
// Set your license
License.Set("GroupDocs.Merger.LowCode.lic")
// Select pages 1, 2, and 3
let splitter = SplitPdf("source.pdf", [| 1; 2; 3 |])
// Save each of them as a separate PDF
splitter.Save("output/page.pdf")
Output
The plugin writes one document per page and adds the page number to the file name: output/page_1.pdf, output/page_2.pdf, and output/page_3.pdf. The output folder is created if it doesn’t exist. To control the names, put {0} in the file name, for example output/page-{0}.pdf; the part number replaces it.
Split a Document into Parts
With SplitMode.Interval, the pages you list mark where each new part starts. The following example cuts a document before pages 7 and 13: part_0.pdf holds pages 1 to 6, part_1.pdf holds pages 7 to 12, and part_2.pdf holds pages 13 to the end. Interval parts are numbered from 0.
using GroupDocs.Merger.Domain.Options;
using GroupDocs.Merger.LowCode;
// Start a new part at pages 7 and 13
var splitter = new SplitPdf("source.pdf", new[] { 7, 13 }, SplitMode.Interval);
// Save one document per part
splitter.Save("output/part.pdf");
Split a Range of Pages
Pass the first and the last page of a range to put every page of the range into a document of its own. Add a RangeMode to keep only the odd or even pages of the range. The following example splits out pages 2, 4, and 6:
using GroupDocs.Merger.Domain.Options;
using GroupDocs.Merger.LowCode;
// Select the even pages from 1 to 6
var splitter = new SplitPdf("source.pdf", 1, 6, RangeMode.EvenPages);
// Save one document per page
splitter.Save("output/even.pdf");
The source document can also be a Stream. For more examples in C#, VB.NET, and F#, see Using SplitPdf to Split PDF 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: