Merge the Whole PDF - ComPDFKit/compdfkit-pdf-sdk-windows GitHub Wiki
ComPDFKit PDF SDK allows you to instantiate multiple CPDFDocument, and you can use the CPDFDocument API to merge two or more PDF files into a single one.
See all details here.
To merge PDF documents into one file, please use the following method:
1. Create a blank PDF document.
CPDFDocument document = CPDFDocument.CreateDocument();
2. Open the PDF documents that contain the pages you want to merge.
// File path
CPDFDocument document1 = CPDFDocument.InitWithFilePath("filePath");
// File path
CPDFDocument document2 = CPDFDocument.InitWithFilePath("filePath2");
- Merge all the pages from the documents you just opened, and import them into the blank PDF document.
document.ImportPagesAtIndex(document1,"",document.PageCount); document.(document2,"",document.PageCount);
- Save the document.
// Save path document.WriteToFilePath("savePath");