-
Notifications
You must be signed in to change notification settings - Fork 2
Extract Pages from PDFs with ComPDFKit
When you extract pages, you can choose the pages you want to extract freely with ComPDFKit PDF SDK. You can also choose how the extracted pages will be put — in one file or each page in a separate file. About the original PDF document, you can choose to keep or delete the extracted pages.
- All the Pages
- Odd Pages
- Even Pages
- Custom Range
The steps involved are quite straightforward, let’s take a look at how easy it is in code.
CPDFDocument document = CPDFDocument.CreateDocument();
Open a PDF document that contains the pages you want to extract.
CPDFDocument document1 = CPDFDocument.InitWithFilePath("filePath");
Extract specific pages from the PDF document that you just opened, and import them into the blank PDF document.
// Pages that need to be extracted, e.g. 2 to 5 pages
document.ImportPagesAtIndex(document1,"2-5",0);
// Save path
document.WriteToFilePath("savePath");
Contact ComPDFKit.