开发者

PHP Server Side Printing

I've been googling for the last few hours now and can't seem to find an answer. I did come close with this question

I've got an intranet site on my windows server running xampp / wamp. I don't really want to give printing access rights to everyone as I'm stingy and only want the company printer being used for printing things off the intranet.

So I'm searching for a way to print intranet pages / documents stored locally on the server silently without the client machine phyiscally printing it. I've found php_printer.dll on php.net but I read that it 开发者_Go百科doesn't print html / documents, only raw data (being plain text)?

Does anyone have any ideas?


In the past I've output a PDF from HTML (look at pisa -- python library for handling this), and then used shell_exec() to print the PDF.

Not very glamorous, but it works. Also, this was on a linux server, so I'm not sure about the capabilities of command-line printing on a Windows box.


I would think that your 'best' option would probably be trying to find a way to interact with the printer driver (does the manufacturer provide anything useful?).

Otherwise you could try having a printMe function that adds the page URL to a db or something similar and then have a Scheduled task running a script every minute or so that prints any URLs that are listed. If you install firefox on your server you can then make it print without showing any prompts (use the Javascript window.print() function). Just make sure your scheduled task loads your script in firefox.

Using this method would also mean that you could log who printed what and when. You could also allow printing of places other than the intranet site (be sure to check that the URL is from the intranet regardless of whether you decide to allow printing from other sites) by creating a bookmarklet.


use the printer functions. they are an extension to php that is only available for php on windows. With that you can print to a local printer que. see the php manual

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜