Scripting PDF printing in Windows XP?
April 28, 2011 3:22 PM   Subscribe

How do I script PDF "printing" in Windows XP?

I need to automate the following process in Windows XP (for work). Since I'm primarily a Mac user at home, I have no idea how to do this.

1) Open up an existing PDF into Acrobat Reader 9.

2) Print the PDF to the printer "Adobe PDF" using the default properties.

3) Save the new PDF in the same directory as the existing one and append "_s" to the end of the file name (so that example.pdf would become example_s.pdf)

It needs to be able to be run on multiple PDF files as a batch operation. It also needs to run on a vanilla XP install since I can't install optional software such as .NET or whatever (no admin).

(For those who are wondering, I'm trying to use the PDF printer engine to reduce the file size of existing bloated PDFs. Printing to the Adobe PDF printer reduces the sizes while maintaining good image quality much better than trying to use Acrobat Reader to do it using the built-in file reduction options such as Document >> Reduce File Size).
posted by buckaroo_benzai to Computers & Internet (6 answers total)
 
It also needs to run on a vanilla XP install since I can't install optional software such as .NET or whatever (no admin).

That adds a layer of difficulty...hrmm..I think you could accomplish this with an AutoIT script, but you might need to build the script on a separate PC loaded with the same Adobe 9 and PDF printer. (if it doesn't support a single user install)

Basically:

- Download and install the full version of AutoIT (hopefully doesn't need admin)
- Run the script editor, and create a new script
- Launch Adobe 9
- Run the recorder...this simplifies the process somewhat as you won't need to know much about the scripting language at this point. It'll record all of your actions and get you started.
- Go through the process of opening a document and printing it to a new file.
- Try compiling this initial script to a portable EXE so you can familiarize yourself with that process.

To make this fully functional however will require a little bit of scripting...not much. Good thing is, it's a widely used tool, so there's tons of info to be found on their forums and in their documentation. If I was writing this...I would probably launch this from an external loop (batch or vbs..whatever is preferred) that passes the filenames and paths as variables to the AutoIT script. The AutoIT script would then take those variables and act on them to control the behavior of Adobe 9. This can be done entirely from within AutoIT as well, from a portable EXE....lots of flexibility.
posted by samsara at 3:44 PM on April 28, 2011


I'm not sure if this will do everything you need, but when I'm on a Windows machine, I use Bullzip.
posted by LuckySeven~ at 3:46 PM on April 28, 2011


Best answer: There's also the possibility of batch processing which could help with shrinking down pdfs.
posted by samsara at 3:49 PM on April 28, 2011 [2 favorites]


Best answer: I would lean towards what samsara said. We use some batch processing functionality at my work, and it's AWESOME.

If Acrobat Reader doesn't have batch processing, see if your overlords will support the purchase of a copy of Acrobat Pro (less than $150). It should cost less of your time to implement and support...
posted by ivan ivanych samovar at 4:25 PM on April 28, 2011


Failing that, however, it looks like this thrilling piece of bedtime reading might be relevant -- JavaScript is used as the internal scripting language of Acrobat.

Adobe's own manual
posted by ivan ivanych samovar at 4:28 PM on April 28, 2011 [1 favorite]


If you send me one of the PDFs you'd like to shrink (email in profile), I'll run it through ghostscript and see what happens to it; if that works, scripting it to do stuff in batches is dead easy.
posted by flabdablet at 6:28 PM on April 28, 2011


« Older A sense of dread in an sunburnt land   |   Where can I watch tonight's Magic/Hawks game... Newer »
This thread is closed to new comments.