如何在 CUPS / foomatic 驱动程序中设置最小边距?

eth*_*u10 8 printer printing drivers cups

我有一台戴尔 2130cn 激光打印机,它没有用于 CUPS 的 PPD 打印驱动程序,所以我使用了通用的 foomatic PCL6(/pxlcolor如果这很重要),它不能正确识别我的打印机的打印边距,因此强制它使用 0.5" 作为顶部和底部, 左右为 0.25。

我如何手动告诉 CUPS 或 foomatic 驱动程序我的打印机实际上有 0.1" 打印边距?

eth*_*u10 9

事实证明,问题不在于打印机中的硬件边距;ppd 文件中的页面定义为信函页面设置了一个带有 0.5" 和 0.25" 边距的可打印区域。


要解决此问题,请编辑打印机 ( /etc/cups/ppd/yourprintername.ppd)的 ppd :
查找*ImageableArea页面大小的定义列表:

*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea 11x17/11x17: "18 36 774 1188"
*ImageableArea A3/A3: "18 36 824 1155"
*ImageableArea A5/A5: "18 36 403 559"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"
Run Code Online (Sandbox Code Playgroud)

找到要修改边距的纸张尺寸并更改定义(引号中的部分)以匹配打印机的实际打印边距:

格式: "<bottom-left x> <bottom-left y> <top-right x> <top-right y>"

边距 + 可打印区域必须保持不变
对我来说 72 个单位 = 1 英寸(因此 0.1" 约为 8 个单位)

所以:

*ImageableArea Letter/US Letter: "8 8 604 784"
Run Code Online (Sandbox Code Playgroud)

在打印区域上提供所需的 0.1" 边距

  • 请注意,格式实际上是“&lt;bottom-left x&gt; &lt;bottom-left y&gt; &lt;top-right x&gt; &lt;top-right y&gt;”。请参阅 [PostScript 打印机描述文件格式规范](https://wwwimages2.adobe.com/content/dam/acom/en/devnet/actionscript/articles/5003.PPD_Spec_v4.3.pdf)。 (5认同)