当我运行lpr <filename>.jpg
时,文件打印出无boder(这就是我想要的)。
当我从Python程序运行subprocess.call("/usr/bin/lpr " + tmp.name, shell=True)
时,它会打印出边框。
我也尝试用“lpr -o StpBorderless = True -o StpiShrinkOutput = Expand .jpg”调用它,但仍然打印相同的边框。
来自lpoptions
的输出显示以下内容(StpBorderless=True
,而StpiShrinkOutput=Expand
应该使其无边框我想。)
如何从Python脚本执行lpr
以使用与从命令行执行它完全相同的选项?
auth-info-required=none
copies=1
device-uri=usb://Canon/CP800?serial=DH00071100000840
finishings=3
job-hold-until=no-hold
job-priority=50
job-sheets=none,none
marker-change-time=0
number-up=1
printer-commands=none
printer-info='Canon CP800'
printer-is-accepting-jobs=true
printer-is-shared=false
printer-location printer-make-and-model='Canon SELPHY-CP770 - CUPS+Gutenprint v5.2.9'
printer-state=3
printer-state-change-time=1433298534
printer-state-reasons=none printer-type=2134028
printer-uri-supported=ipp://localhost:631/printers/Canon_CP800
StpBorderless=True
StpiShrinkOutput=Expand