Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Merging PDF in C# is not straightforward task without using 3rd party library. 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.
The following code snippet also work with Aspose.PDF.Drawing library.
To concatenate two PDF files:
The following code snippet shows how to concatenate PDF files.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void MergeDocuments()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Pages();
// Open PDF documents
using (var document1 = new Aspose.Pdf.Document(dataDir + "Concat1.pdf"))
{
using (var document2 = new Aspose.Pdf.Document(dataDir + "Concat2.pdf"))
{
// Add pages of second document to the first
document1.Pages.Add(document2.Pages);
// Save PDF document
document1.Save(dataDir + "MergeDocuments_out.pdf");
}
}
}
Aspose.PDF Merger is an online free web application that allows you to investigate how presentation merging functionality works.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.