An easy to understand guide on how to copy pages from one pdf document to another with pdf sdk in VBScript with this source code sample. ByteScout Premium Suite: the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can copy pages from one pdf document to another with pdf sdk in VBScript.
The following code snippet for ByteScout Premium Suite works best when you need to quickly copy pages from one pdf document to another with pdf sdk in your VBScript application. Just copy and paste the code into your VBScript application’s code and follow the instructions. If you want to use these VBScript sample examples in one or many applications then they can be used easily.
You can download free trial version of ByteScout Premium Suite from our website to see and try many others source code samples for VBScript.
' This example demonstrates how to copy pages from one document to another ' Open first document Set pdfDocument1 = CreateObject("Bytescout.PDF.Document") pdfDocument1.RegistrationName = "demo" pdfDocument1.RegistrationKey = "demo" pdfDocument1.Load("document1.pdf") ' Open second document Set pdfDocument2 = CreateObject("Bytescout.PDF.Document") pdfDocument2.RegistrationName = "demo" pdfDocument2.RegistrationKey = "demo" pdfDocument2.Load("document2.pdf") ' Add pages from document2 to document1 For i = 0 To pdfDocument2.Pages.Count - 1 pdfDocument1.Pages.Add(pdfDocument2.Pages.Item(i)) Next ' Save document to file pdfDocument1.Save("merged.pdf") ' Open document in default PDF viewer app Set shell = CreateObject("WScript.Shell") shell.Run "merged.pdf", 1, false