C# PDF Combine Library
How to merge, combine two or multiple PDF files into one in byte array using free C#.net sample code in ASP.NET MVC application
Full featured C# sample source code for merging and combining PDF files in Visual C#.NET Program. Free Online Trial Download.
In this tutorial, you learn how to merge multiple pdf files into one pdf using C# PDF library in the ASP.NET Web, Windows applications.
- Merge, combine two PDF files to one new PDF in file, byte array or memory stream
- Combine multiple file types into one PDF file
- Merge, append two PDFDocument objects, byte arrays into one PDF file
How to merge multiple PDF files together using C#
- Professional C#.NET PDF SDK for merging PDF file merging in Visual Studio .NET
- .NET components for batch combining PDF documents in C#.NET class
- Powerful library dlls for mering PDF in both C#.NET WinForms and ASP.NET WebForms
- Free online C#.NET source code for combining multiple PDF pages together in .NET framework
- Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
- Joining & concatenating scanned images to PDF, such as tiff, jpeg, png, gif, bmp, etc
- Merge Microsoft Office Word, Excel and PowerPoint data to PDF form
- Append one PDF file to the end of another and save to a single PDF file
- Merge PDFs with byte array, fields
- High quality .net PDF merger SDK without file size limitation
RasterEdge C#.NET PDF document merging toolkit (XDoc.PDF) is designed to help .NET developers combine PDF document files created by different users to one PDF file.
Thus, C#.NET PDF document merge library control can be counted as an efficient .NET doc solution for keeping PDF document files organized.
This C# .NET PDF document merging control is written in managed C# code and compatible with all .NET developing platforms, like ASP.NET web application and Windows Forms project.
Using this PDF document concatenating library SDK, C# developers can easily merge and append one PDF document to another PDF document file,
and choose to create a new PDF file in .NET class application.
Besides C#.NET PDF document merging function, XDoc.PDF, a professional third-party .NET document imaging toolkit,
also offers other advanced PDF document page processing and manipulating functions, such as PDF page insertion, PDF page deleting,
PDF document splitting, PDF page reordering
and PDF page image and text extraction. Remarkably, all those C#.NET PDF document page processing functions can be implemented independently, without using any Adobe-related software.
Our .NET PDF SDK empowers C# programmers to easily merge and append PDF files with mature APIs.
To be more specific, two or more input PDF documents can be merged and appended together according to its loading sequence,
and then saved and output as a single PDF with user-defined location.
C# append, join, concat one PDF file to another pdf document
Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:
If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.
If using x86, the platform target should be x86.
#region Append one PDF file to another pdf document
internal static void appandPdfToAnother()
{
// get PDFDocument object from one file
String inputFilePath1 = @"C:\1.pdf";
PDFDocument doc1 = new PDFDocument(inputFilePath1);
// get PDFDocument object from another file
String inputFilePath2 = @"C:\2.pdf";
PDFDocument doc2 = new PDFDocument(inputFilePath2);
// append the 2nd document
doc1.AppendDocument(doc2);
// save the document
String outputFilePath = @"C:\Output.pdf";
doc1.Save(outputFilePath);
}
#endregion
C# combine, concatenate multiple PDF files together
If you want to combine more than two pdf files together, you can try the following C# source code.
#region combine multiple PDF files together
internal static void combineNormalPdfFiles()
{
String inputFilePath1 = @"C:\1.pdf";
String inputFilePath2 = @"C:\2.pdf";
String inputFilePath3 = @"C:\3.pdf";
String outputFilePath = @"C:\Output.pdf";
String[] inputFilePaths = new String[3] { inputFilePath1, inputFilePath2, inputFilePath3 };
// Combine three PDF files and output.
PDFDocument.CombineDocument(inputFilePaths, outputFilePath);
}
#endregion
Merge two PDFDocument objects
Merge two documents to a new document:
// get PDFDocument object from one file
String inputFilePath1 = Program.RootPath + "\\" + "1.pdf";
PDFDocument doc1 = new PDFDocument(inputFilePath1);
// get PDFDocument object from another file
String inputFilePath2 = Program.RootPath + "\\" + "2.pdf";
PDFDocument doc2 = new PDFDocument(inputFilePath2);
// merge two documents to a new document
PDFDocument newDoc = (PDFDocument)doc1.MergeDocument(doc2);
// ave the new document
String outputFilePath = Program.RootPath + "\\" + "Output.pdf";
newDoc.Save(outputFilePath);
Append another document:
// get PDFDocument object from one file
String inputFilePath1 = Program.RootPath + "\\" + "1.pdf";
PDFDocument doc1 = new PDFDocument(inputFilePath1);
// get PDFDocument object from another file
String inputFilePath2 = Program.RootPath + "\\" + "2.pdf";
PDFDocument doc2 = new PDFDocument(inputFilePath2);
// append the 2nd document
doc1.AppendDocument(doc2);
// save the document
String outputFilePath = Program.RootPath + "\\" + "Output.pdf";
doc1.Save(outputFilePath);