1

I have a program in a remote server. The users of this program generate a lot of receipt PDF files.

The users of this service need to print these generated PDF's automatically with their local printers. Doing this this manually is too expensive and takes too much time. Is there a way to automatically print the downloaded PDFs?

Amir Hassan Azimi
  • 9,180
  • 5
  • 32
  • 43
David
  • 1,116
  • 3
  • 18
  • 32
  • 2
    Just make downloading serveral pdfs a mass action, one pdf with all receipts in 1 file, so they'll only have to hit print once. – Wrikken Jan 27 '12 at 16:11
  • PHP is a server side language, so no. – craig1231 Jan 27 '12 at 16:15
  • It is trivial to write something client-side that downloads all available PDFs from the server, and prints them automatically... You could even do this in PHP on the client if you wanted. – Brad Jan 27 '12 at 16:17
  • I know that is not possible in PHP, but I'm finding another solution involving not make any click, send pdf to an mail or browser extension, a program in client computer, any.. – David Jan 27 '12 at 16:23

2 Answers2

1

Automatic print email, works fine. http://www.automatic-print-email.com/

With this program you can setup your mail account and print message attachments in PDF. You can configure the frequency mail refresh on seconds, and choose the printer.

Amir Hassan Azimi
  • 9,180
  • 5
  • 32
  • 43
David
  • 1,116
  • 3
  • 18
  • 32
0

Depends on the network architecture you use, but you could think of calling a shell command from php to have the server OS print the files. Additionally, if the user printers are available to the server, you could specify the printer the document has to go to with something like lpr [-Pprinter]...

Of course this requires you to have full control of the server...

Michal
  • 3,262
  • 4
  • 30
  • 50
  • Can I print from linux server to windows clients from another net if i open any router port? – David Jan 27 '12 at 16:55
  • Well, not really, cause your win client does not have a relation to the server OS. It only has a relation (session) to your apache or whatever you use to handle the http requests. This is only an option if you are on a local network. When printing out anything from a remote server, being it a file, a webpage or whatever you can't bypass the printer dialog (that would be a security issue). However, there is a nice workaround for FF described here http://stackoverflow.com/questions/4077832/print-a-page-on-local-using-php-javascript-without-windows-print-dialog-box. – Michal Jan 27 '12 at 17:13
  • Yes, but some clients uses chrome and explorer. I think that only solution is send pdf form email and install a program that automatically print attachemnts as "mailprint" or "automatically print email" – David Jan 27 '12 at 17:34
  • Well then, another possible option would be to send the stuff to Outlook and have it printed by a message rule from there there. Works with message body, however, I suppose that some Visual Basic could make it print attachements too... (but that is beyond me) – Michal Jan 27 '12 at 20:33