PHP 服务器端打印 [英] 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
我的 Windows 服务器上有一个运行 xampp/wamp 的内部网站.我真的不想给每个人打印访问权限,因为我很吝啬,只希望公司打印机用于从 Intranet 打印内容.
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.
所以我正在寻找一种方法来打印本地存储在服务器上的 Intranet 页面/文档,而无需客户端机器进行物理打印.我在 php.net 上找到了 php_printer.dll,但我读到它不打印 html/文档,只打印原始数据(纯文本)?
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 doesn't print html / documents, only raw data (being plain text)?
有人有什么想法吗?
推荐答案
过去我从 HTML 输出 PDF(查看 pisa -- python 库来处理这个),然后使用 shell_exec() 打印PDF.
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.
不是很迷人,但它有效.此外,这是在 linux 服务器上,所以我不确定 Windows 机器上的命令行打印功能.
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.
这篇关于PHP 服务器端打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!