The following code snippet for ByteScout PDF Suite works best when you need to quickly merge two pdf documents with pdf sdk in your VB.NET application. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Use of ByteScout PDF Suite in VB.NET is also described in the documentation included along with the product.
ByteScout PDF Suite free trial version is available on our website. VB.NET and other programming languages are supported.
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