Split a Multi-Page Document into a Single PDF
Splitting a multi-page PDF document into just one single PDF can be done with just a couple of lines of code. See our example to implement it in your project.
With IronPDF, it is very easy to split a single PDF document into multiple documents, each containing only one page.
Get started with IronPDF
Start using IronPDF in your project today with a free trial.
Split a PDF Document
Split a Multipage PDF
Now that you have IronPDF, you can take a multipage document and split it into single-page document files. The idea of splitting a multipage PDF involves copying a single or multiple pages using the CopyPage
or CopyPages
method.
:path=/static-assets/pdf/content-code-examples/how-to/split-multipage-pdf-split-pdf.cs
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("multiPage.pdf");
for (int idx = 0; idx < pdf.PageCount; idx++)
{
// Create new document for each page
PdfDocument outputDocument = pdf.CopyPage(idx);
string fileName = @$"multiPage - Page {idx + 1}_tempfile.pdf";
// Export to new file
outputDocument.SaveAs(fileName);
}
Looking at the code above, you can see that it uses a for loop to iterate through the current PDF document's pages, then uses the CopyPage
method to copy each page into a new PdfDocument object. Finally, the pages are exported as a new document.