watchDirectory Help > Plugins > Automatically run .bat files > Automatically Print PDF files
Automatically Print PDF files
This script is started by watchDirectory to print PDF (Portable Document Format) files. When a new PDF file is detected in the monitored directory, watchDirectory starts this script to print it to the default printer.
What you need
The script uses Adobe® Acrobat® Reader to print the PDF file. If you do not have Acrobat Reader installed,
download Acrobat Reader here.
The script has been tested with Acrobat Reader version 7.
Settings for this script
The upper half of the settings dialog contains general settings for all scripts that can be started by the Automatically run .bat files plugin. Please see that page for instructions.
OPTIONS - Options to pass to Acrobat Reader
The 2 default options (/p /h) cause Reader to print (/p) while not showing its main window (/h).
ACROCMD - Locate Acrobat Reader
Use the Browse button to locate Acrobat Reader. Find the file AcroRd32.exe, normally installed in
C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe
TIP - Printing to another printer
The script prints the PDF to the default printer. If you want to use another printer, you can use the DefPrint utility to change the default printer inside the script.
- Download DefPrint from the page above.
- Inside the watchDirectory Control Center, press Ctrl+9 (or use the "Tools -> Explore Task Directory" menu option) to open the directory where watchDirectory stores all your task information.
- Open the sub directory with the same name you just gave to the new task.
- Inside this directory you will find the script that is started by watchDirectory. It is the file called WD.BAT.
- Open WD.BAT with a plain text-editor (notepad), do not use a word processor to edit the file!!
- Find the line that starts Acrobat Reader (line number 31, near the bottom of WD.BAT), by default it looks like:
"%GDPUTIL%" -runkill 30 "%ACROCMD%" %OPTIONS% "%WD_FILE%"
- Just before that line, insert the command to change the default printer. Assuming the printer is called My Laser Printer, it should now look like:
C:\Bin\defprint /D "My Laser Printer" "%GDPUTIL%" -runkill 30 "%ACROCMD%" %OPTIONS% "%WD_FILE%"