I'm looking for a solution, either win or linux, for printing existing PDFs to network printers (available via our windows print server), preferrably by a 'hot folder' means where I could programatically or manually add PDFs to a folder for "printer x" and the pdf would print to that printer. I'm not sure if this is doable via CUPS, or if some other solution exists.

The key here is, the PDFs already exist. This isn't a 'use a print-to-pdf driver in CUPS' question, but could easily be mistaken for one on first glance. it's a 'print the PDF to a printer' question.

Any suggestions? Open-source would be preferrable.

  • Are you talking about Windows Clients? You know you can open a printer and then drag and drop files into it to print them, right? – TheCleaner May 3 '12 at 18:12
  • www.fileprocessor.info where you can create channels per printer. – juFo Aug 11 '17 at 9:57

For Linux systems try incron (part of the inotify family). It can watch directories and take action on file changes. There's a (rather old) example on howtoforge. Just create an incrontab line like

/pdf_folder/ IN_MODIFY lp -d PDF_PRINTER $@/$#
  • I dl'd incron and it's just what I'm looking for. While my final solution isn't place, a test bash script bound to a 'hot folder' confirms this is gonna work as the solution. – Alan M May 7 '12 at 21:49

You can definitely do that; you should build it out of lp and either ls or find. The general logic would be to use a shell script in a cronjob which, for each entry in a list of files, passes the filename to lp (with options; you could even use awk and find to extract the directory name a file is in and use that as the destination printer).

  • 1
    It would help to lock the files before printing them, so that the next invocation of the cronjob would not print them again. – Dmitri Chubarov May 3 '12 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.