0

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.

Alan M
  • 269
  • 1
  • 3
  • 11
  • 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 03 '12 at 18:12
  • www.fileprocessor.info where you can create channels per printer. – juFo Aug 11 '17 at 09:57

2 Answers2

3

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 $@/$#
charlesbridge
  • 817
  • 5
  • 14
  • 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 07 '12 at 21:49
1

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).

Falcon Momot
  • 24,975
  • 13
  • 61
  • 92