Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print to PDF in VBScript 1

Status
Not open for further replies.

birko19

Programmer
Feb 17, 2012
2
CA
Hello,

I'm trying to write a VBScript that reads a folder with a bunch of PDF files, and prints them as PDF's in another folder. I was able to get this done using the following:

objShell.ShellExecute myPDF, "", "", "print", 1

The only problem with this is it uses Distiller and opens up a save dialogue box for me to specify where to save. I need this to be automated for all the files toward a specific folder that I specify in the code. Any ideas?

Thanks.

 
VBScript that reads a folder with a bunch of PDF files, and prints them as PDF's in another folder

This description sounds like you are simply copying files from one folder to another. I assume there is more to this story, are you also changing the contents of the files or reading some necessary information out of them at the same time? If not, why not simply copy the files?
 
Thank you for the reply, there's definitely more to the story. I tried the saving option, that surely works, the problem is it does not retain the main settings of the original PDF file, instead, it uses the settings of Acrobat on my machine. So say the file is version 1.4, it bumps up the copy to version 1.6 (That's what I have on my machine.

But when I tried to print the PDF to the "Adobe PDF" printer, it keeps everything the same, but my dilemma with that is the original question in this thread.
 
I've not used Distiller myself, but a quick search turned up this:
It lists command line options (easily automated using VBscript) starting on page 16. Also, there is instructions for turning off file prompts on page 19, which may or may not apply to your situation.

If you do some more digging, you may find that Distiller exposes some objects that you can instantiate and control from VBScript, much like you would Excel.Application, for example. This thread from the adobe forums might be useful:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top