Split Pages
The steps to split pages are as follows:
- Create a new
CPDFDocumentobject for each part to be split. - Add the portions of the target document that need to be split to the newly created
CPDFDocumentobjects.
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);