These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Printing to a file, automatically

David_Freihofner
Registered: Mar 28 2007
Posts: 6

I need to be able to open an arbitrary pdf and print that pdf to an arbitrary file on disk - automatically, of course. I use a command like the one described below.
  
To do this, I've enjoyed using the "Unsupported Command Lines" with Acrobat and Reader as described in the Adobe Document "Adobe Acrobat (version 4,5,6,7 and 8 !) Developer FAQ".
 
Current Tests show that these unsupported commands don't work anymore.
 
Sigh - I understand that Adobe has written - for years that these command arguments are not supported, it's only that they've worked for so long - I've considered them a "de facto" standard and I've been hoping they would continue to be supported in the current version - they've made automating my process very easy.
 
The process in question is the ability to print a pdf file to a specified disk file with the command:
 
AcroRd32.exe /t path "printername" "drivername" "portname"
 
It appears that Reader now considers every command argument a file - is this true?
 
I suppose I could use a javascript that I could replace before invoking reader, but I can't find the commands that select an arbitrary file and print to an arbitrary file.

My Product Information:
Reader 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So you've found out why it's not so good to use unsupported features;)

A slightly more difficult, but more robust methodology is to use a 3rd party automation tool like SWITCH (www.gradual.com) or to write your own using the Acrobat IAC API (in the Acrobat SDK) and Visual basic.

JavaScript can open and print files with the "app.openDoc()" and "doc.print()" functions. But you have to have exact info to pass into them. If want Acrobat to do all this in the background you need to run it from an external VB program, using the IAC functions to setup the document and call the necessary JavaScript function to handle silent printing to a specific print driver. You can print silently from IAC without using any JavaScript, but the IAC print doesn't allow you to specify the print driver, where as the JavaScript function does.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script