This article shows how to merge multiple PDF files into a single PDF document using Aspose.PDF for .NET. The example is written in C# but the API can be used in other .NET programming languages as well such as VB.NET. PDF files are merged such that the first one is joined at the end of the other document.
Merge PDF Files using C#
To concatenate two PDF files:
- Create two
Documentobjects, each containing one of the input PDF files.
- Then call the
Addmethod for the
Documentobject you want to add the other PDF file to.
- Pass the
PageCollectioncollection of the second
Documentobject to the first
- Finally, save the output PDF file using the
The following code snippet shows how to concatenate PDF files.