Skip to content
ComPDF
DemoSampleAPI ReferenceFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Merge Pages

The steps to merge pages are as follows:

  1. Create a blank PDF document.
  2. Open the PDF document containing the pages to be merged.
  3. Select all the pages to be merged and combine them into the same document.

This example shows how to merge pages:

C#
CPDFDocument documentforMerge = CPDFDocument.CreateDocument();

CPDFDocument document1 = CPDFDocument.InitWithFilePath("filePath");
CPDFDocument document2 = CPDFDocument.InitWithFilePath("filePath2");

documentforMerge.ImportPagesAtIndex(document1,"1-10",document.PageCount);
documentforMerge.ImportPagesAtIndex(document2,"1-10",document.PageCount);