2. CUPS介绍 3
2.1 CUPS的配置文件 3
2.1.1 cupsd.conf 3
2.1.2 cups-files.conf 3
2.1.3 printcap 3
2.1.4 printers.conf 3
2.2 SPOOL假脱机 4
2.3 CUPS 支持各种打印机,包括: 4
2.4 CUPS的beh 4
2.5 使用beh 5
2.6 安装cups,并激活 6
3. 打印机驱动 6
3.1 lpinfo -m列出已有驱动程序 6
3.2 添加更多的驱动 6
4. 打印相关命令: 7
4.1 有2个打印命令 7
4.2 打印任务管理 7
4.3 查看打印机状态 7
4.4 控制打印机状态 8
4.5 打印机设置 8
5. 添加打印机 8
5.1 找到打印机 9
5.2 找到打印机驱动 9
5.2.1 添加更多的驱动
5.2.2 安装第三方驱动
5.3 添加打印机 9
5.3.1 设置默认打印机 10
5.3.2 更改选项 10
5.3.3 检查状态 11
5.3.4 测试打印 11
5.3.5 打印任务 11
5.4 添加打印机-图形界面 12
5.5 删除打印机 12
6. 其他参考(只有链接和部分摘要,具体请打开链接看原文) 12
6.1 本机使用的打印机Xprinter XP-58的第三方驱动 12
6.2 异常问题检查 13
6.3 开发人员观点中的Foomatic如何运作?(有流程图) 13
6.4 其他Linux系统的参考 13
6.5 openprinting.org的(绝望指南) 13
6.6 查看错误日志 14
6.7 OpenPrinting CUPS快速入门 14
6.8 使用CUPS打印的基础知识 14
6.9 用户角度的教程 15
6.10 打印为PDF
1. 测试环境
Printer: Xprinter XP-58IIH
指令支持: ESC/POS
接口: USB, 蓝牙
Linux系统: Arch Linux
$ sudo pacman -Qi cups
Name : cups
Version : 2.2.11-1
Description : The CUPS Printing System - daemon package
Architecture : x86_64
URL : https://www.cups.org/
Licenses : GPL
Groups : None
Provides : None
Depends On : acl pam libcups>=2.2.11 cups-filters bc dbus systemd
libpaper hicolor-icon-theme
Optional Deps : xdg-utils: xdg .desktop file support [installed]
colord: for ICC color profile support [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 13.92 MiB
Packager : Andreas Radke <andyrtr@archlinux.org>
Build Date : Sun 24 Mar 2019 06:39:26 PM CST
Install Date : Sun 07 Apr 2019 05:07:53 PM CST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
2. CUPS介绍
https://www.ibm.com/developerworks/cn/linux/l-lpic1-108-4/index.html
管理打印机和打印 Ian Shields 2018 年 3 月 14 日发布
CUPS 原先为通用 UNIX 打印系统 (Common UNIX Printing System) 的首字母缩写,是 Linux 的打印机和打印作业管理器。
System 也有一个打印守护程序。它的功能类似于 Berkeley LPD,但采用不同的命令集。您将会经常看到两种具有不同选项但完成相同任务的命令。
例如,来自 Berkeley 实施的 lpr和来自 System V 实施的 lp 都可打印文件。
CUPS 打印系统的核心是作为守护进程运行的 cupsd 打印服务器。
2.1 CUPS的配置文件
2.1.1 cupsd.conf
CUPS 配置文件通常位于 /etc/cups/cupsd.conf 中。
原先 cupsd.conf 中允许的文件、目录和用户配置指令,现在改为存储在 cups-files.conf 中。这样可防止某些类型的特权升级攻击。
2.1.2 cups-files.conf
$ sudo cat /etc/cups/cups-files.conf
# Location of the file listing all of the local printers...
#Printcap /etc/printcap
2.1.3 printcap
自动生成的 /etc/printcap 文件。这是 LPD 打印服务器的配置文件名称,部分应用仍使用它来确定可用的打印机及其属性。
$ sudo cat /etc/printcap
# This file was automatically generated by cupsd(8) from the
# /etc/cups/printers.conf file. All changes to this file
# will be lost.
Xprint|Xprint:rm=tompc:rp=Xprint:
2.1.4 printers.conf
$ sudo cat /etc/cups/printers.conf
# Printer configuration file for CUPS v2.2.11
# Written by cupsd on 2019-04-09 14:41
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer Xprint>
UUID urn:uuid:192cdccd-05bc-3ef7-4582-c6233773ef56
Info Xprint
Location pc
MakeModel Zijiang ZJ-58
DeviceURI usb://Unknown/Printer?serial=?
State Idle
StateTime 1554792072