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");

MergeDocument part1 = new MergeDocument(pdf, 1, 4);

MergeDocument part2 = new MergeDocument(pdf, 5, 8);

Getting Started

NuGet Package

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

NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

GitHub Example Project

Clone or view the example project at GitHub. This example is is the Examples/SplitPDF.cs file.

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?

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

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