Re: [PHP] Printing using php script CRON
Vern wrote: I get: # wget -O -q http://www.comp-wiz.com/index.html | lpr -P hp1300n What I wrote was wget -O -q - http://www.domain.com/file.php | lpr -P hp1300n You forgot - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Printing using php script CRON
[snip] I hate to keep beating a dead horse, but this horse is not quite dead yet. I need to print a php script from a web site using CRON. I'm thinking something like this should work but I don't know enough about it to say that it would. I know that I can run a php script using CRON as such: lynx --dump http://yoursite.com/cronjob.php /dev/null Can I not output this data to a printer? [/snip] If you have a printer attached to the server from where the cron is running you might try lynx --dump http://yoursite.com/cronjob.php lpt1 or something similar. Not tested. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
If you have a printer attached to the server from where the cron is running you might try lynx --dump http://yoursite.com/cronjob.php lpt1 or something similar. Not tested. Actually it's a netwotl printer and in order to print the job I need to type the following on the box: lpr -P hp1300n myfilename.txt So I'm not exctaly sure how I can do that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
On Tuesday 27 July 2004 20:33, Vern wrote: If you have a printer attached to the server from where the cron is running you might try lynx --dump http://yoursite.com/cronjob.php lpt1 or something similar. Not tested. Actually it's a netwotl printer and in order to print the job I need to type the following on the box: lpr -P hp1300n myfilename.txt So I'm not exctaly sure how I can do that. Try: lynx --dump http://yoursite.com/cronjob.php | lpr -P hp1300n -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Mene, mene, tekel, upharsen. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
On Tuesday 27 July 2004 08:33 am, Vern wrote: Actually it's a netwotl printer and in order to print the job I need to type the following on the box: lpr -P hp1300n myfilename.txt So I'm not exctaly sure how I can do that This works great for me. Except that I use lp -d printername filename.txt instead of the command you're using. I can print to any printer that I set up in CUPS on the webserver. I do this from webpages so I'm sure you can get it to work with CRON. $filename = uniqid()..txt; $filehandle = fopen($filename,w); fwrite($filehandle, Hello World); fclose($filehandle); system(lpr -P hp1300n .$filename); James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
One would think this should be really simple but it's not. I need to retrieve the file somewhere on the internet. I read somewhere in order to read a php script's output you need to add the php command in front, as such: php http://yoursite.com/cronjob.php | lpr -P hp1300n however I am getting the following error: Status: 404 suggesting that the page doesn't exist, however it does. Is there something I am missing here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Printing using php script CRON
[snip] One would think this should be really simple but it's not. I need to retrieve the file somewhere on the internet. I read somewhere in order to read a php script's output you need to add the php command in front, as such: php http://yoursite.com/cronjob.php | lpr -P hp1300n however I am getting the following error: Status: 404 suggesting that the page doesn't exist, however it does. Is there something I am missing here? [/snip] You are trying to run a PHP script on a remote site? Have a look at cURL http://www.php.net/curl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
I feel like I taking a hammer and well I'm sure you all know the feeling. cURL does help me to get the file and save the file somewhere locally, however printing a page like this gives me all the html code (i.e. html, etc) and I need the report that is being displayed to the browser in all it's glory (color, graphs and so forth). So somehow I need to simply have the output of this file converted to an image file of some some. You would think that there is and easy command from the command prompt that would allow you to do this. Am I incorrect? Do I have to rewrite this whole page to output to an image or pdf? Seems there should be an easier way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
You could try this: http://marginalhacks.com/Hacks/html2jpg/ Save the page as an image, and then run it through the printer. It does have some overhead though to get it done. Hope it helps, Ed On Tue, 27 Jul 2004, Vern wrote: I feel like I taking a hammer and well I'm sure you all know the feeling. cURL does help me to get the file and save the file somewhere locally, however printing a page like this gives me all the html code (i.e. html, etc) and I need the report that is being displayed to the browser in all it's glory (color, graphs and so forth). So somehow I need to simply have the output of this file converted to an image file of some some. You would think that there is and easy command from the command prompt that would allow you to do this. Am I incorrect? Do I have to rewrite this whole page to output to an image or pdf? Seems there should be an easier way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
Seems to me that this needs XWindows or something install, am I incorrect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
Vern wrote: One would think this should be really simple but it's not. wget -O -q - http://www.domain.com/file.php | lpr -P hp1300n -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
I get: # wget -O -q http://www.comp-wiz.com/index.html | lpr -P hp1300n --16:49:59-- http://www.comp-wiz.com/index.html = `-q' Resolving www.comp-wiz.com... done. Connecting to www.comp-wiz.com[207.234.154.95]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 22,011 [text/html] 100%[== ] 22,011 139.58K/sETA 00:00 16:49:59 (139.58 KB/s) - `-q' saved [22011/22011] lpr: stdin is empty, so no job has been sent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing using php script CRON
On Wednesday 28 July 2004 04:51, Vern wrote: I get: # wget -O -q http://www.comp-wiz.com/index.html | lpr -P hp1300n --16:49:59-- http://www.comp-wiz.com/index.html = `-q' Resolving www.comp-wiz.com... done. Connecting to www.comp-wiz.com[207.234.154.95]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 22,011 [text/html] 100%[== ] 22,011 139.58K/sETA 00:00 16:49:59 (139.58 KB/s) - `-q' saved [22011/22011] lpr: stdin is empty, so no job has been sent. It would be nice if you did a *little* bit of your own research. If you had a look at 'wget --help' or 'man wget' you would have found that the '-O' switch will save contents of URL to file (in this case to the file '-q'). Anyway this is getting completely OT. And as you have indicated in other posts you wanted to print a copy of the URL as rendered via a graphical browser. Neither wget nor lynx or suitable for this task. http://marginalhacks.com/Hacks/html2jpg/ Seems to me that this needs XWindows or something install, am I incorrect? You need to install X and probably a few other bits and pieces as well. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A good marriage would be between a blind wife and deaf husband. -- Michel de Montaigne */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php