Link to home
Start Free TrialLog in
Avatar of denniskroenke
denniskroenke

asked on

How to print ADOBE PDF files in batch

I am having a problem with batch printing of ADOBE PDF files.  I see that there has already been a lot of discussion on this topic, but I still cannot find an acceptable solution to this problem.  Below is what I have learned so far:
1.  ADOBE 4.0 seems to work, using the "/t" print parameter.  This is not, however, an acceptable solution.  We need the current version to work.
2.  Above version 4.0, ADOBE prints one PDF OK, and then it hangs up (does not close).  Program control does not return to the batch file.
3.  ADOBE claims that the command line method is unsupported.  I assume that the recommended ("supported") method would be via "DDE" interface, but I am unable to find anyone who has written one.
4.  Third party solutions that support "Watched Queues" are unacceptable, because we need the capability of going to ANY printer Anytime.  We do not want the maintenance burden of having to define ALL printers and queues on the print server.
5.  Ideally, we would like to issue a simple command and pass the path, filename, and full UNC name of the Printer.  It would also be great if the command would return success/failure flag, in case the PDF was currupt or something... as long as the command never "Hangs up".
6.  Windows has no problem with closing ADOBE Acrobat Reader when you print the PDF by "Right Clicking" it.  (Is this DDE??)
7.  This has evolved into a major problem for us.  It seems to me that there MUST be an easier solution somewhere.
8.  Our users are currently able to attach all kinds of PC files to the database, and we can direct ANY of these in batch to ANY printer (docs, xls, bmp, jpg, etc.)... EXCEPT Adobe PDFs.  I would think that the folks at ADOBE would be inundated with requests for this funtionality.  But when I search ADOBE's site, all I can find is that the question is being asked frequently by the users, but they are being ignored.

How can I get ADOBE to work?
Thank you
Avatar of WelkinMaze
WelkinMaze

Avatar of denniskroenke

ASKER

Yes, I looked at the thread above and this does not help (See #4, above).  Basically, I need to execute a single "DOS-Type" command to print a specified PDF to a specified printer.  The command line interface to Acrobat did this FINE in v4.0, but for reasons unknown, it has become unreliable in all of the newer versions.  

Additionally, back in V4.0, we would occaisionally encounter a PDF file that was either corrupt or contained an "Interactive control" (like a button).  This would cause ADOBE to hang up and stop processing print jobs until an interactive error dialog was dimissed (#5, above).  An ideal solution would print the PDF if possible, yet kill the Acrobat job if not.
Take a look at the tools on this page: http://www.noliturbare.com/ChicksTools.html 
There is also a commercial solution from Traction software, which supports a command line interface. I have no first hand experience with that tool however: http://www.traction-software.co.uk/batchprint/index.html
I have looked at "ChicksTools" and I see that the "PDFP.EXE" program appears to do a good job of "Batch printing" the PDF.  The only problem remaining is what to do if the PDF file is corrupt.  "PDFP" will hang up, as a stray ADOBE dialog box appears in the foreground.  After a long wait, the program will eventually time out and return control to the caller.  The problem now is that the ADOBE dialog panel remains on the desktop, and all subsequent calls to ADOBE fail until a user intervenes and dismisses this "Cannot open" dialog.

This is a great step in the right direction, but to finish the job, I would like to find a way to either modify Chick's PDFP program to "time-out" and kill the ADOBE instance, OR introduce a new tool to verify the integrity/validity of the PDF file before attempting the print.

 
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If I understand correctly, you need to print a pdf from a command line batch file, using the Adobe reader. You can write a simple batch file that does it.  These commands can also be embedded in a VBA or VB script and called using the "Shell" command.

You'll need to find the path to AcroRd32.exe, and make sure it is installed and functioning.  The /p switch prints.  The /h switch hides, but does not close.  The /t switch is supposed to close but does not work, so I don't use it.  We'll use a taskKill command instead.

First line of batch:  [path to adobe]\AcroRd32 /p /h [path and pdf file name] [Printer name] LPT1:
Example: c:\program Files\Adobe\Acrobat 7.0\Reader\AcroRd32 /p /h /t "c:\temp\MyFile.pdf" \\printerpath\HP1000 LPT1:

Second line of batch: taskkill /IM acrord32.exe

This closes adobe task (/IM is image name)

Works fairly well.