Wednesday, August 13, 2014

Automate PDF printing from batch file command line

Adobe Reader is not suitable for printing PDF files using a batch file because it remains open after the print is done and there is no simple, safe & reliable mechanism to close it.  Instead use Ghostscript commandline as shown below:

gswin32c -dPrinted -dBATCH -dNOPAUSE -dNOSAFER -q -dNumCopies=1 "C:\test.pdf"

*Must be a recent version of Ghostscript, e.g. 9.x

No comments:

Post a Comment