Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ali BenchaabanRank #925 · 2.2K reputationPosted Mar 29, 2023, 5:21 PM EDT
Hello Sunny,
https://www.c-sharpcorner.com/article/merge-pdf/
BENCHAABAN Ali
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 29, 2023, 8:28 PM EDT
Hello sunny,
You can do in various way using Itextsharp, IronPdf, Aspose,
Please refer below links,
https://www.c-sharpcorner.com/article/merge-multiple-pdf-files-into-single-pdf-using-itextsharp-in-c-sharp/
https://products.aspose.com/words/net/merge/pdf/
https://www.c-sharpcorner.com/article/merge-pdf/
Leon DRank #851 · 2.6K reputationPosted Mar 29, 2023, 9:24 PM EDT
Hello Sunny,
You can merge pdf files into a single pdf easily with Spire.PDF.
Here is a simple example for you:
using System; using Spire.Pdf; namespace MergePDFs { class Program { static void Main(string[] args) { //Get the paths of the documents to be merged String[] files = new String[] { "C:\\Users\\Administrator\\Desktop\\PDFs\\sample-1.pdf", "C:\\Users\\Administrator\\Desktop\\PDFs\\sample-2.pdf", "C:\\Users\\Administrator\\Desktop\\PDFs\\sample-3.pdf"}; //Merge these documents and return an object of PdfDocumentBase PdfDocumentBase doc = PdfDocument.MergeFiles(files); //Save the result to a PDF file doc.Save("output.pdf", FileFormat.PDF); } } }You can visit this link for more detailed information:
https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Merge-PDF-Files-with-New-Method-in-C.html#1
Marvin ReidRank #1,963 · 746 reputationPosted Jun 1, 2023, 10:58 AM EDT
You can use the PDFFile MergeWith method to combine multiple PDF files in one PDF file. Here is some code which demonstrates this:
string sourceFileName1 = @"C:/Input/File1.pdf"); string sourceFileName2 = @"C:/Input/File2.pdf"); string sourceFileName3 = @"C:/Input/File3.pdf"); string destinationFileName = @"C:/Output/Merged.pdf"); // Merge 1 with (2, 3) and form destination PDFFile pdfFile = new PDFFile(sourceFileName1); pdfFile.MergeWith(new string[] { sourceFileName2, sourceFileName2 }, destinationFileName);https://www.leadtools.com/help/sdk/dh/pdf/pdffile-mergewith(string[],string).html
https://www.leadtools.com/help/sdk/tutorials/dotnet-winforms-merge-pdf-files-to-single-pdf-file.html