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
- Create a
PdfDocument object by passing the file path to the source PDF.
- Create a
MergeDocument object by passing the pdf, starting page and page count.
- Invoke the
Draw method on the Document to output that portion of the PDF.
- 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);
DynamicPDF Generator is available on NuGet and is part of the
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
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.