---
title: "Split PDF pages into multiple files | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/editor/split/"
md_url: "https://www.nutrient.io/guides/dotnet/editor/split.md"
last_updated: "2026-05-19T18:11:33.911Z"
description: "Learn how to split PDF pages into multiple smaller documents programmatically in C# using Nutrient .NET SDK. Divide your PDFs for better organization."
---

# Split PDF pages into multiple pages in C#

This guide outlines three basic examples of splitting a PDF file:

- [Splitting a PDF into two](#splitting-a-pdf-into-two).

- [Splitting all PDF pages](#splitting-all-pdf-pages).

- [Splitting odd and even pages in a PDF](#splitting-odd-and-even-pages-in-a-pdf).

## Splitting a PDF into two files

To split a PDF file into two files, follow the steps below.

1. Create three `GdPicturePDF` objects.

2. Create three empty output PDF files with the [`NewPDF`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~NewPDF.html) method.

3. Copy the PDF pages with the [`ClonePage`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~ClonePage.html) method to the newly created PDF files.

4. Save the PDF files with the [`SaveToFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html) method.

The code below shows how to split a PDF file into two files at a specified page:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
using GdPicturePDF gdpicturePDF1 = new GdPicturePDF();
using GdPicturePDF gdpicturePDF2 = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
gdpicturePDF1.NewPDF();
gdpicturePDF2.NewPDF();
// Specify the first page of the second PDF file.
int splitPage = 3;
for (int i = 1; i <= gdpicturePDF.GetPageCount(); i++)
{
    if (i < splitPage) gdpicturePDF1.ClonePage(gdpicturePDF, i);
    else gdpicturePDF2.ClonePage(gdpicturePDF, i);
    gdpicturePDF1.SaveToFile(@"C:\temp\output1.pdf");
    gdpicturePDF2.SaveToFile(@"C:\temp\output2.pdf");
}

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Using gdpicturePDF1 As GdPicturePDF = New GdPicturePDF()
Using gdpicturePDF2 As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    gdpicturePDF1.NewPDF()
    gdpicturePDF2.NewPDF()
    ' Specify the first page of the second PDF file.
    Dim splitPage = 3
    For i As Integer = 1 To gdpicturePDF.GetPageCount()
        If i < splitPage Then
            gdpicturePDF1.ClonePage(gdpicturePDF, i)
        Else
            gdpicturePDF2.ClonePage(gdpicturePDF, i)
        End If
        gdpicturePDF1.SaveToFile("C:\temp\output1.pdf")
        gdpicturePDF2.SaveToFile("C:\temp\output2.pdf")
    Next
End Using
End Using
End Using

```

#### Used methods

- [`ClonePage`]

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`NewPDF`]

- [`SaveToFile`]

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Splitting all PDF pages

To split all PDF pages into separate files, follow the steps below.

1. Create two `GdPicturePDF` objects.

2. Create an empty output PDF file with the [`NewPDF`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~NewPDF.html) method.

3. For each page:
   - Create an empty PDF.
   - Copy the current PDF page with the [`ClonePage`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~ClonePage.html) method to the newly created PDF file.
   - Save the PDF file with the [`SaveToFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html) method.

The code below shows how to split all PDF pages into separate files:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
using GdPicturePDF gdpictureSinglePDF = new GdPicturePDF();
    gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
    for (int i = 1; i <=gdpicturePDF.GetPageCount(); i++)
    {
        gdpictureSinglePDF.NewPDF();
        gdpictureSinglePDF.ClonePage(gdpicturePDF, i);
        string page = i.ToString();
        gdpictureSinglePDF.SaveToFile(string.Format(@"C:\temp\output{0}.pdf", page));
    }

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Using gdpictureSinglePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    For i As Integer = 1 To gdpicturePDF.GetPageCount()
        gdpictureSinglePDF.NewPDF()
        gdpictureSinglePDF.ClonePage(gdpicturePDF, i)
        Dim page As String = i.ToString()
        gdpictureSinglePDF.SaveToFile(String.Format("C:\temp\output{0}.pdf", page))
    Next
End Using
End Using

```

#### Used methods

- [`ClonePage`]

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`NewPDF`]

- [`SaveToFile`]

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Splitting odd and even pages in a PDF

To split odd and even pages of a PDF file into two PDF files, follow the steps below.

1. Create three `GdPicturePDF` objects.

2. Create two empty output PDF files with the [`NewPDF`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~NewPDF.html) method — the first for odd pages, and the second for even pages.

3. For each page:
   - Check if current PDF page is odd or even.
   - Copy the current PDF page to one of the new PDF files with the [`ClonePage`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~ClonePage.html) method.

4. Save the PDF files with the [`SaveToFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html) method.

The code below shows how to split odd and even pages of a PDF file into two PDF files:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
using GdPicturePDF gdpictureOddPDF = new GdPicturePDF();
using GdPicturePDF gdpictureEvenPDF = new GdPicturePDF();
    gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
    gdpictureOddPDF.NewPDF();
    gdpictureEvenPDF.NewPDF();
    for (int i = 1; i <= gdpicturePDF.GetPageCount(); i++)
    {
        if (i % 2!= 0) gdpictureOddPDF.ClonePage(gdpicturePDF, i);
        else gdpictureEvenPDF.ClonePage(gdpicturePDF, i);
    }
    gdpictureOddPDF.SaveToFile(@"C:\temp\outputOdd.pdf");
    gdpictureEvenPDF.SaveToFile(@"C:\temp\outputEven.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
Using gdpictureOddPDF As GdPicturePDF = New GdPicturePDF()
Using gdpictureEvenPDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    gdpictureOddPDF.NewPDF()
    gdpictureEvenPDF.NewPDF()
    For i As Integer = 1 To gdpicturePDF.GetPageCount()
        If i Mod 2 <> 0 Then
            gdpictureOddPDF.ClonePage(gdpicturePDF, i)
        Else
            gdpictureEvenPDF.ClonePage(gdpicturePDF, i)
        End If
    Next
    gdpictureOddPDF.SaveToFile("C:\temp\outputOdd.pdf")
    gdpictureEvenPDF.SaveToFile("C:\temp\outputEven.pdf")
End Using
End Using
End Using

```

#### Used methods

- [`ClonePage`]

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`NewPDF`]

- [`SaveToFile`]

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Add an image to a PDF using C#](/guides/dotnet/editor/add-image-to-pdf.md)
- [Add an image to another image using C#](/guides/dotnet/editor/add-image-to-image.md)
- [Add a page to a PDF or a TIFF image in C# .NET](/guides/dotnet/editor/add-page.md)
- [Add text to an image using C#](/guides/dotnet/editor/add-text-to-image.md)
- [PDF and image editor in C#.NET](/guides/dotnet/editor.md)
- [Attach a file to a PDF in C#](/guides/dotnet/editor/attach-a-file.md)
- [Add text to PDFs in C#](/guides/dotnet/editor/add-text-to-pdf.md)
- [Modify EXIF metadata using C#](/guides/dotnet/editor/metadata-exif.md)
- [Merge PDFs in C#](/guides/dotnet/editor/merge-or-combine.md)
- [Edit IPTC metadata using C#](/guides/dotnet/editor/metadata-iptc.md)
- [Read and edit PDF XMP metadata using C#](/guides/dotnet/editor/metadata-xmp.md)
- [Read and edit PDF page label metadata using C#](/guides/dotnet/editor/metadata-pdf-page-label.md)
- [Add watermarks to PDFs and images in C#](/guides/dotnet/editor/watermark.md)

