一、前置准备:安装并配置CUPS服务
CUPS(Common Unix Printing System)是Linux系统下管理打印任务的核心服务,LibreOffice依赖它实现网络打印。
sudo apt-get update
sudo apt-get install cups cups-client cups-bsd foomatic-filters
sudo systemctl start cups
sudo systemctl enable cups
/etc/cups/cupsd.conf,修改以下关键设置:
Listen localhost:631改为Listen 0.0.0.0:631(允许所有IP访问CUPS服务);<Location />部分,修改为:<Location />
Order allow,deny
Allow From all
</Location>
sudo systemctl restart cups
ufw),需允许631端口(CUPS默认端口)的流量:sudo ufw allow 631/tcp
sudo ufw reload
二、添加网络打印机到CUPS
通过网络添加打印机至CUPS,使其能被LibreOffice识别。
http://<Debian主机IP>:631(如http://192.168.1.100:631),使用管理员账户登录(默认用户名为root,密码为系统管理员密码)。Internet Printing Protocol (IPP)、LPD/LPR Queue、Windows Printer via SAMBA),输入打印机的IP地址或主机名(如ipp://192.168.1.200/ipp/print);三、在LibreOffice中配置网络打印机
Ctrl+P),弹出打印对话框。四、常见问题排查
sudo systemctl status cups);hplip、Canon的cnijfilter),通过CUPS界面重新安装驱动。