How to Merge PDF Files using C#

This simple tutorial explains the details on how to merge PDF files using C#. You can merge two or more PDF files by following the steps provided in this article. Moreover, it also contains C# code to merge PDF files so that you can quickly test the feature in your environment.

Steps to Merge PDF Files using C#

  1. Add the reference to Aspose.PDF for .NET into your PDF merging application
  2. Create PdfFileEditor class instance to combine PDF files
  3. Specify the input PDF file names and paths using a string array
  4. Merge the PDF files using the Concatenate method

These steps describe how using C# merge PDF files into one document feature can be implemented in the application. Simply configure the library and specify the file paths with file names using a string type array. Then perform the merging operation to append the pages of each input file into a single PDF document.

C# Code to Merge PDF Files

You can merge PDF using C# with basically a single method call however the prerequisite steps include specifying the file names. Furthermore, any of the overloads for the Concatenate method can be used where the files stored in a stream or the disk can be merged. The result can be saved into an HttpResponse object also if you are working with the web applications.

In this article, we have learned how using C# merge PDF files feature can be integrated into your .NET Framework-based applications. However, if you want to learn the conversion of PDF to a Text file, refer to the article on how to convert PDF to Text using C#.

 English