Hi there, I suggest that you can use Spire.PDF for .NET (available on NuGet) to do this job. Spire.PDF is a C# class library for creating and manipulating PDF documents on .NET platform.
Below is the code example for your referenece.
using System.IO;
using Spire.Pdf;
namespace MergeFiles
{
class Program
{
static void Main(string[] args)
{
//Specify source file
string sourceFile = @"C:\Users\Administrator\Desktop\source.pdf";
//Get files to merge in the "ToMerge" folder
string[] filesToMerge = Directory.GetFiles(@"C:\Users\Administrator\Desktop\ToMerge");
//Specify the output folder
string outputFolder = @"C:\Users\Administrator\Desktop\Merged\";
//Create a new document
PdfDocumentBase newPdf;
//Traverse all files in the "ToMerge" folder
for (int i = 0; i < filesToMerge.Length; i++)
{
//Merge the source file "A" and another file in the "ToMerge" folder
newPdf = PdfDocument.MergeFiles(sourceFile, filesToMerge[i]);
//Save the document to a different PDF file
string fileName = string.Format("Output-{0}.pdf", i + 1);
newPdf.Save(outputFolder + fileName, FileFormat.PDF);
}
}
}
}