Split PDF in C# (.NET Core)

Split PDF into multiple small PDFs in C#, .NET, .NET Core and Standard

How to Split PDF pages

Splitting a PDF with DynamicPDF Merger is a simple and straightforward task. Below are the steps and sample code for this.

Steps to Split a PDF

  1. Create a Pdfdocument object by passing the file path to the source PDF.
  2. Create a MergeDocument object by passing the pdf, starting page and page count.
  3. Invoke the Draw method on the Document to output that portion of the PDF.
  4. Repeat step 2 and 3 for the remaining parts of the PDF you'd like to split.

Sample code - C#

PdfDocument pdf = new PdfDocument("DocumentA.pdf");

// Part 1
MergeDocument part1 = new MergeDocument(pdf, 1, 4);
Part1.Draw("output-part1.pdf");

// Part 2
MergeDocument part2 = new MergeDocument(pdf, 5, 8);
part2.Draw("output-part2.pdf");

Getting Started

NuGet Package

DynamicPDF Merger is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET package. The Core Suite package includes Generator, Merger and ReportWriter.

Nuget Logo
NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

Example Project

An example project showing this functionality can be cloned or viewed from GitHub:

GitHub Logo
Clone or View Example Project on GitHub

DynamicPDF Merger Information

More information can be found here:

Available in Other Platforms

DynamicPDF Merger PDF Library is available for Java and COM/AxtiveX platforms. Refer to the respective product pages for more details.

Why Choose DynamicPDF?

  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 17 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!