The sample shows steps and algorithm of how to merge two PDF documents and how to make it work in your VB.NET application. Want to merge two PDF documents in your VB.NET app? ByteScout PDF SDK is designed for it. ByteScout PDF SDK is the library for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings.
The SDK samples like this one below explain how to quickly make your application do merge two PDF documents in VB.NET with the help of ByteScout PDF SDK. In your VB.NET project or application you may simply copy & paste the code and then run your app! You can use these VB.NET sample examples in one or many applications.
ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.
Imports Bytescout.PDF Module Module1 Sub Main() ' Open first document Dim document1 = New Document("document1.pdf") document1.RegistrationName = "demo" document1.RegistrationKey = "demo" ' Open second document Dim document2 = New Document("document2.pdf") document2.RegistrationName = "demo" document2.RegistrationKey = "demo" ' Add pages from document2 to document1 For i As Integer = 0 To document2.Pages.Count - 1 document1.Pages.Add(document2.Pages(i)) Next ' Save merged document document1.Save("MergedDocument.pdf") ' Open merged document in default PDF viewer application Process.Start("MergedDocument.pdf") End Sub End Module