IRONSOFTWAREHOME
Split a PDF and Extract Pages in C#
using IronPdf;

const string html =
    @"<p> Hello Iron </p>
    <p> This is 1st Page </p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 2nd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 3rd Page</p>";

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);

//take the first page
var page1doc = pdf.CopyPage(0);
page1doc.SaveAs("Split1.pdf");

//take the pages 2 & 3
var page23doc = pdf.CopyPages(1, 2);
page23doc.SaveAs("Split2.pdf");
Imports IronPdf

Const html As String = "<p> Hello Iron </p>" & _
    "<p> This is 1st Page </p>" & _
    "<div style = 'page-break-after: always;' ></div>" & _
    "<p> This is 2nd Page</p>" & _
    "<div style = 'page-break-after: always;' ></div>" & _
    "<p> This is 3rd Page</p>"

Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(html)

'Take the first page
Dim page1doc = pdf.CopyPage(0)
page1doc.SaveAs("Split1.pdf")

'Take the pages 2 & 3
Dim page23doc = pdf.CopyPages(1, 2)
page23doc.SaveAs("Split2.pdf")
NuGet Download
PM > Install-Package IronPdf
Split a PDF and Extract Pages in C#

Split a PDF and Extract Pages in C#

IronPDF makes the process of editing your PDF document layouts through splitting and extracting pages a breeze. With IronPDF, you can extract singular or ranges of pages into new PdfDocument objects, which can then be saved or further edited. This is all done thanks to the PdfDocument.CopyPage method.

Before we get into the core process behind splitting PDF files, we create the HTML string which will be used to make the example PDF. The ChromePdfRenderer class is then used to convert the HTML string into a PDF document. The RenderHtmlAsPdf method performs the conversion, and the resulting PDF is stored in the PdfDocument object.

Now, we can start splitting the PDF. First, we use the CopyPage(0) method to copy the first page of the PDF, storing it in the page1Doc variable. This simple line of code extracts the specified page from the PDF. Then, using the SaveAs method, we save the page we extracted as a new, separate PDF file.

For extracting page ranges, the CopyPages method is used to extract the pages within the specified page range from the original PDF. (Remember that pages are zero-indexed, so 1 and 2 refer to the second and third pages.) The resulting extracted pages are stored in the page23Doc variable. Now, you can go on to further manipulate these extracted pages, or utilize the SaveAs method to save the extracted pages as a new PDF document.

Learn to Split Multi-Page PDFs with IronPDF Now
View on GitHub

Ready to Get Started?

Nuget Downloads 21,105,021Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999