macOS打印机管理 —— 通过命令行修改第三方打印机默认选项

macOS 下修改第三方打印机选项

背景

macOS 上安装完打印机驱动( 喷墨彩色打印机 ) 后默认输出颜色为彩色 , 很多时候打印机只用于日常的文件打印, 出于节省成本考虑就需要将默认输出颜色设置为黑白的, 但是通过菜单点击设置的方式过于复杂,所以就有了本文中的 macOS 下通过命令的方式配置打印机选项

测试环境

操作系统: macOS Monterey 12.3
打印机品牌: 富士施乐

需求:

打印机驱动安装完后, 需要将彩色打印机的颜色输出更改为默认黑白输出模式, 如图;

在这里插入图片描述

解决方案

方案思路:

  1. 确定打印机配置文件路径

找到当前打印机的 ppd 文件 , macOS 下默认的打印机 ppd 文件路径为/etc/cups/ppd/ ,比如这里的打印机名为 example ,
输入命令 ls /etc/cups/ppd/ 即可看到当前安装的打印机 ppd 文件.

~ ls /etc/cups/ppd/
exampleprinter.ppd
  1. 确定打印机颜色输出相关选项

使用如下命令确定打印机输出颜色相关选项

cat /etc/cups/ppd/example.ppd | grep Color 得到的输出如下;

 ~ cat /etc/cups/ppd/exampleprinter.ppd | grep  Color
*ColorDevice: True
*DefaultColorSpace: CMYK
*% ColorMode Information ===================
*OpenUI *FXColorMode/Output Color:PickOne
*OrderDependency: 20.0 AnySetup *FXColorMode
*DefaultFXColorMode: Color
*FXColorMode Color/Color: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(AUTOCOLOR)>> pop"
*FXColorMode Black/Black and White: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(GRAYSCALE)>> pop"
*CloseUI: *FXColorMode
*ja.Translation FXColorMode/カラーモード: ""
*ja.FXColorMode Color/カラー: ""
*ja.FXColorMode Black/白黒: ""

根据输出基本可以猜测到的值为 *DefaultFXColorMode: Color , 这里ppd 文件选项前面的* 代表默认设置.

  1. 使用 lpadmin 进行设置

lpadmin -p exampleprinter -o FXColorMode=Black

经过两次尝试最终得知这里的FXColorMode的值设置为Black即可出厂设置的设置名称 , 运行完以上设置后即可修改打印机默认颜色输出模式, 举一反三,其他选项都可以使用该方法进行修改.

附上打印机默认选项设置前后对比,

➜  ~ cat /etc/cups/ppd/exampleprinter.ppd | grep Color # 设置前查看打印机选项
*ColorDevice: True
*DefaultColorSpace: CMYK
*% ColorMode Information ===================
*OpenUI *FXColorMode/Output Color:PickOne
*OrderDependency: 20.0 AnySetup *FXColorMode
*DefaultFXColorMode: Color
*FXColorMode Color/Color: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(AUTOCOLOR)>> pop"
*FXColorMode Black/Black and White: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(GRAYSCALE)>> pop"
*CloseUI: *FXColorMode
*ja.Translation FXColorMode/カラーモード: ""
*ja.FXColorMode Color/カラー: ""
*ja.FXColorMode Black/白黒: ""
➜  ~ lpadmin -p exampleprinter -o FXColorMode=Black
➜  ~ cat /etc/cups/ppd/exampleprinter.ppd | grep Color # 查看设置后的打印机选项
*ColorDevice: True
*DefaultColorSpace: CMYK
*% ColorMode Information ===================
*OpenUI *FXColorMode/Output Color:PickOne
*OrderDependency: 20.0 AnySetup *FXColorMode
*DefaultFXColorMode: Black
*FXColorMode Color/Color: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(AUTOCOLOR)>> pop"
*FXColorMode Black/Black and White: "<</TYPE(SET) /KEY(RENDERMODE) /VALUE(GRAYSCALE)>> pop"
*CloseUI: *FXColorMode
*ja.Translation FXColorMode/カラーモード: ""
*ja.FXColorMode Color/カラー: ""
*ja.FXColorMode Black/白黒: ""
➜  ~
资源分为10份,此为第9份文件,包含以下打印机PPD文件: hp-officejet hp-officejet_r80xi hp-officejet_series_300 hp-officejet_series_310 hp-officejet_series_320 hp-officejet_series_330 hp-officejet_series_350 hp-officejet_series_520 hp-officejet_series_570 hp-officejet_series_580 hp-officejet_series_590 hp-officejet_series_600 hp-officejet_series_610 hp-officejet_series_630 hp-officejet_series_700 hp-officejet_series_710 hp-officejet_series_720 hp-officejet_series_725 hp-officejet_t_series hp-officejet_v30 hp-officejet_v40 hp-officejet_v40xi hp-officejet_v45 hp-photosmart_100 hp-photosmart_1115 hp-photosmart_1215 hp-photosmart_1218 hp-photosmart_130 hp-photosmart_1315 hp-photosmart_140_series hp-photosmart_230 hp-photosmart_240_series hp-photosmart_2570_series hp-photosmart_2600_series hp-photosmart_2700_series hp-photosmart_3100_series hp-photosmart_3200_series hp-photosmart_320_series hp-photosmart_3300_series hp-photosmart_330_series hp-photosmart_370_series hp-photosmart_380_series hp-photosmart_420_series hp-photosmart_470_series hp-photosmart_5510_series hp-photosmart_5510d_series hp-photosmart_5520_series hp-photosmart_6510_series hp-photosmart_6520_series hp-photosmart_7200_series hp-photosmart_7345 hp-photosmart_7400_series hp-photosmart_7510_series hp-photosmart_7520_series hp-photosmart_7550 hp-photosmart_7600_series hp-photosmart_7700_series hp-photosmart_7800_series hp-photosmart_7900_series hp-photosmart_8000_series hp-photosmart_8100_series hp-photosmart_8200_series hp-photosmart_8400_series hp-photosmart_8700_series hp-photosmart_a310_series hp-photosmart_a320_series hp-photosmart_a430_series hp-photosmart_a440_series hp-photosmart_a510_series hp-photosmart_a520_series hp-photosmart_a530_series hp-photosmart_a610_series hp-photosmart_a620_series hp-photosmart_a630_series hp-photosmart_a640_series hp-photosmart_a710_series hp-photosmart_a820_series hp-photosmart_b010_series hp-photosmart_b109a_series hp-photosmart_b110_series
资源分为10份,此为第10份文件,包含以下打印机PPD文件: hp-photosmart_b8500_series hp-photosmart_c309a_series hp-photosmart_c3100_series hp-photosmart_c4100_series hp-photosmart_c4200_series hp-photosmart_c4340_series hp-photosmart_c4380_series hp-photosmart_c4400_series hp-photosmart_c4500_series hp-photosmart_c4600_series hp-photosmart_c4700_series hp-photosmart_c5100_series hp-photosmart_c5200_series hp-photosmart_c5300_series hp-photosmart_c5500_series hp-photosmart_c6100_series hp-photosmart_c6200_series hp-photosmart_c6300_series hp-photosmart_c7100_series hp-photosmart_c7200_series hp-photosmart_c8100_series hp-photosmart_d110_series hp-photosmart_d5060_series hp-photosmart_d5100_series hp-photosmart_d5300_series hp-photosmart_d5400_series hp-photosmart_d6100_series hp-photosmart_d7100_series hp-photosmart_d7200_series hp-photosmart_d7300_series hp-photosmart_d7400_series hp-photosmart_d7500_series hp-photosmart_estn_c510_series hp-photosmart_ink_adv_k510 hp-photosmart_p1000 hp-photosmart_p1100 hp-photosmart_plus_b209a-m hp-photosmart_plus_b210_series hp-photosmart_prem-web_c309n-s hp-photosmart_prem_c310_series hp-photosmart_prem_c410_series hp-photosmart_premium_c309g-m hp-photosmart_pro_b8300_series hp-photosmart_pro_b8800_series hp-photosmart_wireless_b109n-z hp-printer_scanner_copier_300 hp-psc_1000_series hp-psc_1100_series hp-psc_1200_series hp-psc_1300_series hp-psc_1310_series hp-psc_1358_series hp-psc_1400_series hp-psc_1500_series hp-psc_1600_series hp-psc_2100_series hp-psc_2150_series hp-psc_2170_series hp-psc_2200_series hp-psc_2210_series hp-psc_2300_series hp-psc_2350_series hp-psc_2400_series hp-psc_2500_series hp-psc_500 hp-psc_720 hp-psc_750 hp-psc_750xi hp-psc_760 hp-psc_780 hp-psc_780xi hp-psc_900_series hp-psc_920 hp-psc_950 hp-psc_950vr hp-psc_950xi hp-smart_tank_350_series hp-smart_tank_500_series hp-smart_tank_510_series hp-smart_tank_530_series hp-smart_tank_610_series hp-smart_tank_plus_550_series hp-smart_tank_plus_570_series hp-smart_tank_plus_650_series hp-smart_tank_wireless_450_series hp-tango
资源分为10份,此为第7份文件,包含以下打印机PPD文件: hp-laserjet_professional_m1136_mfp hp-laserjet_professional_m1137_mfp hp-laserjet_professional_m1138_mfp hp-laserjet_professional_m1139_mfp hp-laserjet_professional_m1212nf_mfp hp-laserjet_professional_m1213nf_mfp hp-laserjet_professional_m1214nfh_mfp hp-laserjet_professional_m1216nfh_mfp hp-laserjet_professional_m1217nfw_mfp hp-laserjet_professional_m1218nfg_mfp hp-laserjet_professional_m1218nfs_mfp hp-laserjet_professional_m1219nf_mfp hp-laserjet_professional_m1219nfg_mfp hp-laserjet_professional_m1219nfs_mfp hp-laserjet_professional_p1102 hp-laserjet_professional_p1106 hp-laserjet_professional_p1106w hp-laserjet_professional_p1107 hp-laserjet_professional_p1107w hp-laserjet_professional_p1108 hp-laserjet_professional_p1108w hp-laserjet_professional_p1109 hp-laserjet_professional_p1109w hp-laserjet_professional_p1566 hp-laserjet_professional_p1567 hp-laserjet_professional_p1568 hp-laserjet_professional_p1569 hp-laserjet_professional_p1606dn hp-laserjet_professional_p1607dn hp-laserjet_professional_p1608dn hp-laserjet_professional_p1609dn hp-laserjet_professional_p_1102w hp-mopier_240-pcl3 hp-mopier_320-pcl3 hp-neverstop_laser_100x hp-neverstop_laser_mfp_120x hp-officejet_100_mobile_l411 hp-officejet_150_mobile_l511 hp-officejet_200_mobile_series hp-officejet_250_mobile_series hp-officejet_2620_series hp-officejet_3830_series hp-officejet_4000_k210 hp-officejet_4100_series hp-officejet_4105 hp-officejet_4115_series hp-officejet_4200_series hp-officejet_4255 hp-officejet_4300_series hp-officejet_4400_k410 hp-officejet_4500_g510a-f hp-officejet_4500_g510g-m hp-officejet_4500_g510n-z hp-officejet_4500_k710 hp-officejet_4610_series hp-officejet_4620_series hp-officejet_4630_series hp-officejet_4650_series hp-officejet_5100_series hp-officejet_5200_series hp-officejet_5500_series hp-officejet_5600_series hp-officejet_5740_series hp-officejet_6000_e609a hp-officejet_6000_e609n hp-officejet_6100 hp-officejet_6100_series hp-officejet_6150_series hp-officejet_6200_series hp-officejet_6300_series hp-officejet_6500_e709a hp-officejet_6500_e709n hp-officejet_6500_e710a-f hp-officejet_6500_e710n-z hp-officejet_6600 hp-officejet_6700 hp-officejet_6800 hp-officejet_6950 hp-officejet_6960 hp-officejet_7000_e809a_series
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小白的杂货铺

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值