Bluepoint Design

Practical cost effective solutions   
PDF Print

Home
Up
Hex Edit
Right Click Activation
PDF Print
System Variables
Often one needs to print a bunch of Acrobat files but you don't want to have Acrobat open, display, prompt you for settings and close. With most programs there will be a simple switch like "/p" to accomplish this but there is no such switch in the normal user documentation. Adobe has always been secretive this way. Well there is a command line switch /t for Acrobat and Acrobat Reader that we can use in ME to eliminate this problem. Please refer to this Adobe's Developer Knowledgebase article.

Disclaimer: Most of, but not all of what's mentioned here is using Acrobat 6 proper, now Acrobat Reader, on Windows 2000 Pro, XP Pro, and Vista. However in my experience Acrobat Reader works just the same. If you have a different environment and see different behavior please let me know and we'll add it here.

The KB article makes it look more difficult than it is and makes no mention of several pitfalls. The /t command line parameter is the key. But in most cases one can use just the syntax acrobat.exe /t "filename.pdf" "printername". Paste the line below into ME to see an example.

<LAUNCHDEL2:0:01Acrobat.exe<PARAM>/t "filename.pdf" "printer name">

Flaws:

  1. Some of the online documentation I read suggested that if no printer was specified that the default printer would be used. In my experience this is not the case and apparently it prints nowhere. You must always specify the printer.
  2. Acrobat must already be open. There is no mention of this but if Acrobat is not open the document will not close. If you have an empty Acrobat open it will open another instance of Acrobat and close it when it's done. This can be very valuable for flow control. More on that later. In ME it's my opinion that it's best to have it open already.
  3. Flow control. There is none. If you try to print too many in rapid succession Acrobat will reach some limit in the number of sessions that can be open at once and if you print 50 PDF's you will get about 14.

Printer name: This is the name as it exactly appears in the printers folder like "HP LaserJet 4 Plus". Also one can specify a network path but if the printer is already installed locally I found that you don't need this capability.

Acrobat Reader:

These tricks work for both Acrobat and Acrobat Reader. Just substitute AcroRd32.exe for acrobat.exe.

Acrobat already open:

Just open it first and close it when you're done. First off the window title can be used for flow control and secondly it will make it run a lot quicker. We're all painfully aware of how long it takes Acrobat to initialize so if it's already open things will go a lot faster if it doesn't have to initialize ever time.

Flow control:

You need flow control if you are doing more than about a dozen or so PDFs. There is some limit to the number of windows Acrobat can have open at one time and if ME keeps Launching PDF print commands it will eventually balk. As I see it there are two solutions for this, first is to monitor the window status. Add some timing to wait until after the window disappears and thus done printing. The second approach is to use a batch file. I think this is superior for several reasons. First off the flow control is automatic and you don't have to add any timing. You see it waits for Acrobat to finish before running the next line. Secondly you can have ME go on and do something else while it's running! How cool is that? One warning though, you need to specify the entire path the the executable in the batch file or change the search path. Update: I found a third solution, use the Wait for File Ready command. Adobe will impose a file lock and one can use this for timing very efficiently.

What's a batch file?

If you're new to computers you might not know what a batch file. Simply it's a text file with a .BAT extension that can be run like a program. Basically anything you can type at a command prompt you can list in this file and it will run them all automatically for you. Then run it from the Launch Program command in ME. You can create one by using the "Append to text file option in the Variables Modify command. Just add a CRLF after each line. Oh, and make sure the file doesn't exist first and delete it after you're done. But that's a subject for another page...

 
Practical cost effective solutions