使用PHP打印到网络打印机 [英] print to a network printer using PHP

查看:277
本文介绍了使用PHP打印到网络打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用LPR或类似工具通过PHP直接打印到网络打印机?

is it possible to print directly to a network printer with PHP using LPR or something similar?

任何指针?

谢谢.

推荐答案

当然可以.如果您使用的是Linux,请使用LPR.

exec("lpr -P 'printer' -r 'filename.txt'");

有关LPR命令的更多信息. 查看LPR文档.您可以轻松地从PHP中显示打印队列和其他内容.

More on LPR commands. Take a look into LPR docs. You can easily show the print-queue and more from PHP.

如果您使用的是Windows,请使用打印

exec("print /d:LPT2: C:\filename.txt");

更多有关印刷语法的信息
或查看本指南对命令行打印有更深入的说明.

More on print syntax
Or take a look into this guide that has a deeper explanation of command-line printing.

这篇关于使用PHP打印到网络打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆