使用 cupsd 配置打印机设置
在这一步中,你将学习如何使用 cupsd
命令配置打印机设置。
首先,让我们检查 "MyPrinter" 打印机的当前配置:
sudo cupsd -p MyPrinter -l
示例输出:
printer MyPrinter
State: idle, accepting jobs
Device URI: ipp://localhost/printers/MyPrinter
Printer is shared
Printer is located in .
Printer is connected
Printer driver: generic
Printer is enabled and ready to print
如你所见,打印机当前处于 "idle" 状态,并且正在接受任务。
现在,让我们将打印机的默认纸张尺寸更改为 A4:
sudo lpadmin -p MyPrinter -o media=a4
为了验证更改,让我们再次检查打印机配置:
sudo cupsd -p MyPrinter -l
示例输出:
printer MyPrinter
State: idle, accepting jobs
Device URI: ipp://localhost/printers/MyPrinter
Printer is shared
Printer is located in .
Printer is connected
Printer driver: generic
Printer is enabled and ready to print
Default paper size: a4
你可以看到默认纸张尺寸现在设置为 "a4"。
接下来,让我们暂停打印机:
sudo cupsd -p MyPrinter -o printer-state-reasons=paused
为了验证更改,再次检查打印机状态:
sudo cupsd -p MyPrinter -l
示例输出:
printer MyPrinter
State: paused, accepting jobs
Device URI: ipp://localhost/printers/MyPrinter
Printer is shared
Printer is located in .
Printer is connected
Printer driver: generic
Printer is disabled and not ready to print
Default paper size: a4
打印机现在处于 "paused" 状态,并且无法打印。