I'm looking for a way to merge multiple PDF files into one with VBScript, only with Acrobat and Distiller - without using any third-party software. Although I really searched hard for a solution on the web, I couldn't find one. Can someone please help me out here?
Thank you! S.
I've had success in the past using Acrobat's Interapplication Communication feature from VBScript. I don't have a full version of Acrobat to test with, but this should at least give you a starting point:
Dim app
Set app = CreateObject("AcroExch.App")
Dim srcDoc, destDoc
Set srcDoc = CreateObject("AcroExch.PDDoc")
Set destDoc = CreateObject("AcroExch.PDDoc")
srcDoc.Open srcPath
destDoc.Create
destDoc.InsertPages 0, srcDoc, 0, srcDoc.GetNumPages(), 0
destDoc.Save 0, destPath
srcDoc.Close
destDoc.Close
app.Exit
The OLE Automation section of the API reference contains a list of the available classes and methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With