如何在 CUPS 打印中选择单色/彩色选项

如何在 CUPS 打印中选择单色/彩色选项

我想从命令行打印页面(通常是 PDF 文件)。我使用 delp命令:

lp mydoc.pdf

我找到了几个选项(单面打印与双面打印、N-up 打印等),但不知道该如何指定彩色打印或灰度打印。可以吗?

编辑:这是 Rinzwind 建议的命令的输出:

sudo grep -i color HP_Color_LaserJet_MFP_M277dw_295BCF_.ppd
*ModelName: "Color LaserJet MFP M277dw"
*Product: "(Color LaserJet MFP M277dw)"
*NickName: "Color LaserJet MFP M277dw"
*ShortNickName: "Color LaserJet MFP M277dw"
*ColorDevice: True
*MediaType StationeryColored/stationery-colored: "<</MediaType(StationeryColored)>>setpagedevice"
*OpenUI *ColorModel/Mode de couleur: PickOne
*OrderDependency: 10 AnySetup *ColorModel
*ColorModel Gray/Niveaux de gris: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*ColorModel RGB/Couleur: "<</cupsColorSpace 19/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*DefaultColorModel: RGB
*CloseUI: *ColorModel

我试过

lp -o ColorModel=Gray file.pdf
lp -o ColorModel=Color file.pdf

但没有发现任何差异。

后来,我使用了第二种方法,使用 lpoptions:

lpoptions -l
PageSize/Media Size: Letter Legal Executive FanFoldGermanLegal 4x6 5x8 *A4 A5 A6 B5 B6 Env4x6 Oficio 195x270mm 184x260mm 7.75x10.75 Postcard DoublePostcardRotated Env10 EnvMonarch EnvISOB5 EnvC5 EnvDL Custom.WIDTHxHEIGHT
Duplex/Two-Sided: *None DuplexNoTumble DuplexTumble
InputSlot/Paper Feed: *Auto Tray1 Tray2 ManualFeed
HPOption_Duplexer/Duplex Unit: *True False
HPPJLColorAsGray/Print Color as Gray: on *off
HPRGBEmulation/RGB Color: *DefaultSRGB PhotoSRGB Adobe VividSRGB HPRGBEmulationNone
HPEdgeControl/Edge Control: HPEdgeControlOff Light *Normal Max
HPGeneralHalftone/Halftone: *Smooth Detail
HPTextNeutralGrays/Text Neutral Grays: *Black ProcessBlack
HPGraphicsNeutralGrays/Graphics Neutral Grays: *Black ProcessBlack
HPPhotoNeutralGrays/Photo Neutral Grays: Black *ProcessBlack
HPPJLEconoMode2/EconoMode: on *off
MediaType/Media Type: *Unspecified Plain HPEcoSMARTLite HPLaserJet90 HPColorLaserMatte105 HPPremiumChoiceMatte120 HPBrochureMatte150 HPCoverMatte200 HPMattePhoto200 HPPremiumPresentationGlossy120 HPBrochureGlossy150 HPTrifoldBrochureGlossy150 HPBrochureGlossy200 Light6074 Intermediate8595 MidWeight96110 Heavy111130 ExtraHeavy131175 HeavyGlossy111130 ExtraHeavyGlossy131175 CardGlossy176220 ColorLaserTransparency Labels Letterhead Envelope HeavyEnvelope Preprinted Prepunched Colored Bond Recycled Rough HeavyRough OpaqueFilm

我注意到了

HPPJLColorAsGray/Print Color as Gray: on *off

因此,使用

lp -o HPPJLColorAsGray=on file.pdf

我得到了我想要的。

答案1

一般建议:在 PPD 文件中查找打印机。

grep -i grey /etc/cups/ppd/{printer}.ppd
grep -i gray /etc/cups/ppd/{printer}.ppd

(我认为它会是灰色的;))

它将显示该选项的名称。

那么这可以工作但这取决于打印机......

lp -o ColorModel=Gray mydoc.pdf

作为选择你也可以改变药水在打印之前在配置文件中,但这也要求您每次都将其重置回彩色。lpoptions -l | grep Color将显示如何将其设置为灰色。

相关内容