note 28687 deleted from ref.printer by sobak

From: Date: Thu, 24 Nov 2016 20:29:18 +0000
Subject: note 28687 deleted from ref.printer by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207560@lists.php.net to get a copy of this message
Note Submitter: bertATnerdstockDOTorg ---- If you want to address the printer from your PHP-application in a Un*x environment: This is possible if you use a different method. In Unix it would not be logical to address your printer directly from php, but you could for instance generate a PDF-file with PDFlib (or a textfile, or a PNG/JPEG image with GD or what have you) and write it from your php-script to a directory that you use as a "printer-outbox." Next, you write a shellscript that calls some unix tool to print all pdf or other documents in your "outbox" directory and then deletes all files in that directory. Then you use crontab to run this script every minute or as often as you think it's neccessary. You could of course also call the shellscript from your php-application with exec() but you'll probably want to avoid using exec() and the like for security reasons.

« previous php.notes (#207560) next »