VB.NET: Online Guide
File: Merge, Append PDF Files
File: Merge, Append PDF Files
Home ›› XDoc.PDF ›› VB.NET PDF: Merge and Append PDF

VB.NET PDF - Merge PDF Document Using VB

VB.NET Guide and Sample Codes to Merge PDF Documents in .NET Project

VB.NET PDF Document Merging Library Overview

RasterEdge PDF merging library is a mature library SDK which adds powerful Portable Document Format (PDF) editing solutions and capacities to your system for VB.NET developers. This library control can be easily installed into .NET development environment such as Microsoft Visual Studio.

When you have downloaded the RasterEdge Image SDK for .NET, you can unzip the package to find the RasterEdge.Imaging.PDF.dll in the bin folder under the root directory. We have also provided you with detailed PDF processing demo project along with sample codes, which you can find in the Demos folder under RasterEdge.Imaging.Demo directory with the file name RasterEdge.Imaging.Demo.PDF.

RasterEdge .NET Image SDK has included a variety of image and document processing library components, one of which is the PDF document editing control DLL. This library DLL can efficiently enable developers to merge two or more PDF document into one and then save as another PDF document using Visual Basic .NET programming codes.

Different from PDF document appending, which is processed by directly tagging the second PDF file to the target one, this PDF file merge function will put the two target PDF together and save as new PDF, without changing the previous two PDF documents at all. This guiding page will help you merge two or more PDF documents into a single one in a Visual Basic .NET imaging application.

VB.NET Demo code to Combine and Merge Multiple PDF Files into One

This part illustrates how to combine three PDF files into a new file in VB.NET application. You may also combine more PDF documents together.

Dim inputFilePath1 As String = Program.RootPath + "\\" + "1.pdf"
Dim inputFilePath2 As String = Program.RootPath + "\\" + "2.pdf"
Dim inputFilePath3 As String = Program.RootPath + "\\" + "3.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"
Dim inputFilePaths = New String() {inputFilePath1, inputFilePath2, inputFilePath3}

' Combine three PDF files and output.
PDFDocument.CombineDocument(inputFilePaths, outputFilePath)

VB.NET Demo code to Append PDF Document

In addition, VB.NET users can append a PDF file to the end of a current PDF document and combine to a single PDF file.

' get PDFDocument object from one file
Dim inputFilePath1 As String = Program.RootPath + "\\" + "1.pdf"
Dim doc1 As PDFDocument = New PDFDocument(inputFilePath1)
' get PDFDocument object from another file
Dim inputFilePath2 As String = Program.RootPath + "\\" + "2.pdf"
Dim doc2 As PDFDocument = New PDFDocument(inputFilePath2)

' append the 2nd document

' save the document
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"