Splitting a PDF document is the process of saving each page into a new, separate PDF document. For example, splitting a three-page PDF document will produce three, single-page PDF documents.
To split a PDF document using ImageGear .NET:
- Read the PDF document into a System.IO.Stream object.
- Read the stream using ImGearFileFormats.LoadDocument(), casting the ImGearDocument object returned to an ImGearPDFDocument object.
- Determine the PDF page count using the ImGearPDFDocument.Pages property.
- For each PDF page:
The following is a sample method that illustrates how to split a single PDF document into several single-page PDF documents:
PDF support needs to be initialized first for this snippet to work. To get familiar with initializing IGNET, initializing PDF support, loading a PDF, saving a PDF, and terminating PDF support, try any one of the
tutorials.
Refer to the Samples documentation.