最近公司买了台 小米米家喷墨打印机 居然 不支持 不同路由器之间的打印(不同网段), 研究如下
- 在Linux Ubuntu下可以通过
ipp://[打印机IP地址]/
添加打印机 并打印正常 - Windows 下通过 IPP 添加打印机,打印时打印队列里直接错误,在打印队列里面能显示机器打印状态(其它同事打印文档名称). 找不到错误日志.无法定位错误.最后通过IPP协议发送跳过Windows 打印驱动解决.
总结一下过程:
- 扫描打印机,查看打印机支持的协议
~: nmap -v [打印机IP地址] Starting Nmap 7.92 ( https://nmap.org ) at 2021-11-11 09:34 CST Initiating Ping Scan at 09:34 Scanning [打印机IP地址] [2 ports] Completed Ping Scan at 09:34, 0.00s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 09:34 Completed Parallel DNS resolution of 1 host. at 09:34, 12.36s elapsed Initiating Connect Scan at 09:34 Scanning [打印机IP地址] [1000 ports] Discovered open port 443/tcp on [打印机IP地址] Discovered open port 80/tcp on [打印机IP地址] Discovered open port 631/tcp on [打印机IP地址] Discovered open port 5357/tcp on [打印机IP地址] Completed Connect Scan at 09:34, 0.30s elapsed (1000 total ports) Nmap scan report for [打印机IP地址] Host is up (0.021s latency). Not shown: 996 closed tcp ports (conn-refused) PORT STATE SERVICE 80/tcp open http 443/tcp open https 631/tcp open ipp 5357/tcp open wsdapi Read data files from: /snap/nmap/2536/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 12.74 seconds
- 添加IPP网络共享打印机(2种方式)
- 手动 输入
http://[打印机IP地址]:631/
自行查找 或 指定 `http://[打印机IP地址]:631/ipp/print - 代码
rundll32 printui.dll,PrintUIEntry /if /b "Mi Wireless Inkjet Printer" /f "Mi Wireless Inkjet Printer_1.0.4.18\HNAAAQ40.inf" /r "http://[打印机IP地址]:631/ipp/print" /m "Mi Wireless Inkjet Printer"
- 手动 输入
- 测试打印机(失败)
- 感觉驱动缺陷,尝试IPP协议打印 Internet Printing Protocol (IPP) for nodejs,和 ipp-printjob-java 成功打印
参考资料:
rundll32.exe printui.dll,PrintUIEntry
Printer Drivers Installation and Troubleshooting Guide 代码添加驱动名称和模块