Skip to content
Guides

Extract Pages

This example shows how to extract pages:

java
CPDFDocument extractDocument = CPDFDocument.createDocument(context);
// Extract the first page of the original document and save it in a new document.
extractDocument.importPages(document, new int[]{0}, 0);
kotlin
val extractDocument = CPDFDocument.createDocument(context)
// Extract the first page of the original document and save it in a new document.
extractDocument.importPages(document, intArrayOf(0), 0)