Merge PDF in C++

High-speed and cross-platform C++ library for merging PDF files using C++ code

Merge PDF to PDF using Aspose.Slides

Aspose.Slides for C++ is a powerful C++ library used to create, convert, merge, and manipulate presentations, PDFs, and other documents. When you merge PDF to PDF, you are effectively combining pages from 2 documents to obtain one PDF file. Aspose.Slides allows you merge PDFs in different ways. You get to merge PDFs with all their shapes, styles, texts, formatting, etc.

Merge PDF to PDF in C++

Using Aspose.Slides for C++ , you can merge PDF files quickly with just a few lines of code

C++ code for merging PDF to PDF


auto pres = System::MakeObject<Presentation>();
pres->get_Slides()->RemoveAt(0);

pres->get_Slides()->AddFromPdf(u"InputPDF1.pdf");
pres->get_Slides()->AddFromPdf(u"InputPDF2.pdf");

pres->Save(u"pres.pdf", SaveFormat::Pdf);

How to merge PDF in C++

  1. Install Aspose.Slides for C++. See Installation .

  2. Add the library as a reference in your project.

  3. Create an instance of the Presentation class.

  4. Load the PDF files you want to merge.

  5. Save the resulting PDF.

Merge PDF Files Online

How to Merge PDF in Python

Merge other files

You can also combine files in other formats to get a single file