Tech Specs
How-to C#
How-to VB.NET
C# PDF: How to PDF Create PDF Export File and Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF Viewer & Editor Work with Other SDKs Barcode Read Barcode Create OCR Twain
Quick to Start
Home ›› XDoc.PDF ›› C# PDF: Quick to Start

C#.NET PDF: Quick to Start by Using .NET XDoc.PDF SDK

To Have Quick Evaluation of .NET XDoc.PDF SDK in Visual C# Console Application

Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.

As a leading professional third-party SDK supplier in the field of image and document management, RasterEdge has always been devoted to providing various effective and fully-functional imaging solutions for developers who are working on different .NET developing applications.

This C#.NET PDF document processing toolkit, RasterEdge XDoc.PDF SDK for .NET is one of the most strongly-featured and mature document imaging library toolkits on the market, which is designed to help developers implement PDF-related tasks in their C#.NET applications.

Using this C#.NET PDF document processor control, you can easily and quickly complete PDF document creating and loading, PDF document conversion, PDF content redaction, PDF document annotation, PDF document protection and more in any type of a 32-bit or 64-bit .NET application, including ASP.NET web service and Windows Forms for any .NET Framework version from 2.0 to 4.5.

As you know, there're various reliable PDF document processing features that can be implemented in C#.NET programming. And you may want to have a quick testing on RasterEdge XDoc.PDF after downloading its free trial package online.  To meet your requirement, on this quick to start page, we will tell how to create a C# console application, merge two PDF files, and save into a new PDF file.

Create a C#.NET Console Application

Open Visual Studio and click "New" from toolbar. Note, Visual Studio 2005 and above versions are available), ;

Choose "C# Language" and "Console Application" respectively to create a project.

Sample C# Code for Merging Two PDF Files and Save in .NET Application

By following steps below, your C# project will merge the two input PDF files according to priority, and then create a new PDF file to a defined output path.

Add necessary XDoc.PDF DLL libraries into your created C# application as references.









Use namespace "RasterEdge.Imaging.Basic";

Use namespace "RasterEdge.XDoc.PDF";

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.

Copy of the following C# sample code to your application.

String inputFilePath1 = Program.RootPath + "\\" + "1.pdf";
String inputFilePath2 = Program.RootPath + "\\" + "2.pdf";
String outputFilePath = Program.RootPath + "\\" + "Output.pdf";
String[] inputFilePaths = new String[2] { inputFilePath1, inputFilePath2 };

// Combine two PDF files.
PDFDocument.CombineDocument(inputFilePaths, outputFilePath);