On this page
Guides
Split Pages
The steps to split pages are as follows:
- Create a new
CPDFDocument
object for each part to be split. - Add the portions of the target document that need to be split to the newly created
CPDFDocument
objects.
This example shows how to split pages:
java
CPDFDocument documentPart1 = CPDFDocument.createDocument();
// Split the first and second pages into separate sections.
documentPart1.importPages(document, new int[]{0,1}, 0);
CPDFDocument documentPart2 = CPDFDocument.createDocument();
// Split the third, fourth, and fifth pages into the second section.
documentPart2.importPages(document, new int[]{2,3,4}, 0);