PPTX DOCX XLSX PDF ODP
Aspose.PDF  Product Family
PDF

PDF Document Merging Solution

Combine multiple PDF files as separate documents with free cross-platform Apps and APIs. Native APIs to combine PDF files using .NET, .NET Core, Xamarin, Java, C++ & Android

How to Merge PDF files Using Aspose.PDF Library

In order to merge PDF file, we’ll use Aspose.PDF API which is a feature-rich, powerful and easy to use document manipulation API. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.

High Code APIs to Combine Document Data

Native APIs to combine PDF files using .NET, .NET Core, Xamarin, Java, C++ & Android. Merging one or more PDF documents is a very popular task. The Aspose.PDF library does an excellent job with it. The example is written in C#, but the API can be used in other .NET programming languages such as VB.NET. PDF files are merged in such a way that the first one is joined at the end of the other document. Aspose.PDF shows combining files of various formats. Follow the link and get acquainted with all the possibilities of combining files with the Aspose.PDF library.

There are many reasons why you might want to merge PDF files. For example, merging PDF files allows you to print a single file instead of queuing multiple documents for printing, while merging related files simplifies the process of managing and storing many documents by reducing the number of files you need to search for and organize.

Try to merge PDF files via C#

Combine PDF via C# with Aspose.PDF for .NET Library.

 

Example code to Merge PDF files, C#.

    // Open first document
    Document pdfDocument1 = new Document(_dataDir + "Concat1.pdf");
    // Open second document
    Document pdfDocument2 = new Document(_dataDir + "Concat2.pdf");

    // Add pages of second document to the first
    document1.Pages.Add(document2.Pages);
    document.Save(_dataDir+"ConcatenatedPDF.pdf");
 

Try to merge PDF files via Java

Combine PDF via Java with Aspose.PDF for Java Library.

 

Example code to Merge PDF files, Java.

// Create PdfFileEditor object
PdfFileEditor fileEditor = new PdfFileEditor();
String[] files = new String[] { "file1.pdf", "file2.pdf", "pdf3.pdf" };
// Merge multiple PDF files
fileEditor.concatenate(files, "merged-pdf.pdf");
 

Try to merge PDF files via C++

Combine PDF via C++ with Aspose.PDF for C++ Library.

 

Example code to Merge PDF files, C++.

// Open first document
auto doc1 = MakeObject<Document>(u"file1.pdf");

// Open second document
auto doc2 = MakeObject<Document>(u"file2.pdf");

// Add pages of second document to the first
doc1->get_Pages()->Add(doc2->get_Pages());

// Save concatenated output file
doc1->Save(u"merged-output.pdf");
 

Try to merge PDF files via Python

Combine PDF via Python with Aspose.PDF for .NET in Python Library.

 

Example code to Merge PDF files, Python.

    // Open first document
    Document merge_file1 = new Document("PDF1.pdf");
    // Open second document
    Document merge_file2 = new Document("PDF2.pdf");
    // Add pages of second document to the first
    merge_file1.Pages.Add(merge_file2.Pages);
    // Save concatenated output file
    merge_file1.Save("mergedPDF.pdf");
 

PDF Merger online

Merge PDF documents by using our Live Demos with following benefits.

  No need to download or setup anything
  No need to write any code
  Just upload file and hit the View button
  Instantly Merge file