Need PDF Printing to Printer utility

I need a program or utility (free preferrably, paid if it's easy to setup and use) that will print PDFs automatically.

Every night, a client receives dozens to hundreds of PDFs via SFTP from one of their clients.  These documents need to be printed (unfortunately).  They want a system that can either be scripted or set to check folders (and sub folders) for new files and print them automatically throughout the night.

I've done some research and found an AutoIT compiled script but it doesn't work well because some of these pages are being (incorrectly) identified as 8.5x13 when the utility attempts to print them (printing them with Acrobat (and reviewing the print options) indicates they are 8.5x11).  And of course, when the page size changes, the job hangs and stops all other jobs until you fix it...

So I need something that can do this intelligently... shrink the page to fit, ignore the page size and just print to whatever paper is present (cutting off excess - which will almost never actually happen), etc.

Anyone have any suggestions?

I'm willing to script a utility that WORKS so it doesn't have to do everything... but if someone has a product designed to monitor (a) folder(s) and print the contents, including PDFs, that's great too.

I don't think I can use Acrobat because it wants to leave the program open after printing... 900 instances of acrobat would be a problem in the morning...

And using a script to subsequently kill acrobat isn't practical... some of these print jobs could be small - a few pages... others could be hundreds of pages and unless there's a way to programmatically tell when the job is done, at least fully spooled, I can't plan on killing the process.
LVL 99
Lee W, MVPTechnology and Business Process AdvisorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorAuthor Commented:
Testing a solution using Ghostscript and gsprint now... looking promising.
JohnBusiness Consultant (Owner)Commented:
First, I have not done this.

Looking at this to assist you, have you seen the following - free for non commercial use, so easy to try. Batch prints more than just PDF.
I think everything you're looking for can be done using VBS then schedule the script to run in the task scheduler.

It won't be hard to program a VB script to:

1.  Check the folder and subfolders for new file
2.  Print the file
3.  Record and/or move each successfully printed file to a different folder so it doesn't get reprinted

I am sure you can filter the extension in VBS to only print PDF files.

As for the PDF reader to use, try Sumatra PDF, it's a standalone executable.

I saw VBS example of using Sumatra to print the PDF:

filename = "C:\path\to\some.pdf"
Set sh = CreateObject("WScript.Shell")
sh.Run "sumatrapdf.exe -print-to-default """ & filename & """", 0, True

Under the printing options you can also have it to not scale, shrink and fit, and silent printing:

Not an easy solution but highly flexible.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Lee,
What should be done with each file after it is printed? Delete it? Move it to an "already printed" folder? Leave it in the "watched folder" but develop a way to know that it has already been printed? Something else? Regards, Joe

The following has a powershell example.

Much also depends on the Printer's options,

IMHO, it is not a wise choice to delete.

I think there was a discussion and a tool that can monitor a folder for new files, that can then run commands....
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Arnold,
IMHO, it is not a wise choice to delete.
I agree, but some users want it, as it is time-consuming to go back and do the deletions manually at a later time. For example, discussed at this EE thread:

Of course, it is critical that it be an option...and not the default option.
discussion and a tool that can monitor a folder for new files, that can then run commands
Also discussed at this EE thread:

Regards, Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
Lee mentioned an AutoIT script in his initial post. I don't know AutoIT, but I do know AutoHotkey (which is a fork of AutoIT) and can probably provide an AutoHotkey solution, but I've been waiting for answers to my questions in the #a42642528 post. I think that an AutoHotkey script that watches the folder and prints the incoming PDFs via a command line (such as the /t option on AcroRd32.exe) would work nicely. Regards, Joe
Joe Winograd, Fellow&MVEDeveloperCommented:
Testing a solution using Ghostscript and gsprint now... looking promising.
Hi Lee,
It's been more than five months since that last post of yours. I'm wondering how your promising-looking test turned out and/or if you're still interested in this question. Regards, Joe
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Utilities

From novice to tech pro — start learning today.