在.ppd中添加自定义页面大小的最简单方法是什么?

问题描述 投票:8回答:4

我想在打印机的.ppd(PostScript打印机定义)文件中添加自定义页面尺寸。我需要添加什么才能使新的页面大小正常工作?

printing cups ppd
4个回答
15
投票

你必须在4个不同的地方为每个额外的页面尺寸添加数值。

  1. for PageSize,
  2. 对于 PageRegion,
  3. 对于 ImageableArea
  4. 对于 PaperDimension

最好的,你拿一张PPD,搜索这些关键词所包含的部分。

*OpenUI *PaperSize: PickOne
....
*CloseUI *PaperSize

.

*OpenUI *PageSize: PickOne
....
*CloseUI *PageSize

以及以

*DefaultImageableArea: ...

.

*DefaultPaperDimension: ...

使用你在其中找到的线条作为你新条目的模板。请注意,尺寸是以PostScript点为单位(其中72pt == 1inch ~= 2.54cm)。

注意事项。

  1. 在PPD中的4个地方分别添加你的新行。
  2. 确保你的新媒体尺寸使用统一的名称。
  3. 确保你的PPD中没有任何语法错误。
  4. 一旦你完成了(或者当你在编辑它的时候),检查你的PPD与 cupstestppd 实用程序(在 Linux 和 Mac OS X 上可用)。

更新

关于测试PPD与 cupstestppd:

默认情况下,这将报告错误为 **FAIL** 即使它发现了一些 "不那么重要 "的语法问题(PPD字符串翻译、过滤器、UIConstraints、配置文件、媒体大小)。你可以稍微放宽这些严格的检查,使用 -W all 以便将所有这些内容仅作为警告报告,而不是作为错误报告。

cupstestppd -W all /path/to/PPDfile.ppd

如果返回的行数是 WARN size ... 你应该密切关注他们,并确保你修复PPD。


1
投票

我有HP LaserJet 1200。Foomaticpxlmono驱动程序提供的PPD文件缺少一些标准纸张尺寸。我更新了它,并加入了以下声明。

*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 100 AnySetup *PageSize
*DefaultPageSize: A4
*PageSize Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*FoomaticRIPOptionSetting PageSize=Letter: " -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792"
*End
*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*FoomaticRIPOptionSetting PageSize=Executive: " -dDEVICEWIDTHPOINTS=522 -dDEVICEHEIGHTPOINTS=756"
*End
*PageSize Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*FoomaticRIPOptionSetting PageSize=Legal: " -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=1008"
*End
*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842"
*End
*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*FoomaticRIPOptionSetting PageSize=A5: " -dDEVICEWIDTHPOINTS=420 -dDEVICEHEIGHTPOINTS=595"
*End
*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
*FoomaticRIPOptionSetting PageSize=A6: " -dDEVICEWIDTHPOINTS=298 -dDEVICEHEIGHTPOINTS=420"
*End
*PageSize A7/A7: "%% FoomaticRIPOptionSetting: PageSize=A7"
*FoomaticRIPOptionSetting PageSize=A7: " -dDEVICEWIDTHPOINTS=210 -dDEVICEHEIGHTPOINTS=298"
*End
*PageSize EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*FoomaticRIPOptionSetting PageSize=EnvISOB5: " -dDEVICEWIDTHPOINTS=499 -dDEVICEHEIGHTPOINTS=709"
*End
*PageSize EnvISOB6/Envelope B6: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB6"
*FoomaticRIPOptionSetting PageSize=EnvISOB6: " -dDEVICEWIDTHPOINTS=354 -dDEVICEHEIGHTPOINTS=499"
*End
*PageSize EnvISOB7/Envelope B7: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB7"
*FoomaticRIPOptionSetting PageSize=EnvISOB7: " -dDEVICEWIDTHPOINTS=250 -dDEVICEHEIGHTPOINTS=354"
*End
*PageSize B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*FoomaticRIPOptionSetting PageSize=B5: " -dDEVICEWIDTHPOINTS=516 -dDEVICEHEIGHTPOINTS=729"
*End
*PageSize B6/B6 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B6"
*FoomaticRIPOptionSetting PageSize=B6: " -dDEVICEWIDTHPOINTS=363 -dDEVICEHEIGHTPOINTS=516"
*End
*PageSize B7/B7 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B7"
*FoomaticRIPOptionSetting PageSize=B7: " -dDEVICEWIDTHPOINTS=258 -dDEVICEHEIGHTPOINTS=363"
*End
*PageSize Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*FoomaticRIPOptionSetting PageSize=Env10: " -dDEVICEWIDTHPOINTS=297 -dDEVICEHEIGHTPOINTS=684"
*End
*PageSize EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*FoomaticRIPOptionSetting PageSize=EnvDL: " -dDEVICEWIDTHPOINTS=312 -dDEVICEHEIGHTPOINTS=624"
*End
*PageSize EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*FoomaticRIPOptionSetting PageSize=EnvMonarch: " -dDEVICEWIDTHPOINTS=279 -dDEVICEHEIGHTPOINTS=540"
*End
*PageSize EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*FoomaticRIPOptionSetting PageSize=EnvC5: " -dDEVICEWIDTHPOINTS=459 -dDEVICEHEIGHTPOINTS=649"
*End
*PageSize EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
*FoomaticRIPOptionSetting PageSize=EnvC6: " -dDEVICEWIDTHPOINTS=323 -dDEVICEHEIGHTPOINTS=459"
*End
*PageSize EnvC7/Envelope C7: "%% FoomaticRIPOptionSetting: PageSize=EnvC7"
*FoomaticRIPOptionSetting PageSize=EnvC7: " -dDEVICEWIDTHPOINTS=230 -dDEVICEHEIGHTPOINTS=323"
*End
*CloseUI: *PageSize

*OpenUI *PageRegion: PickOne
*OrderDependency: 100 AnySetup *PageRegion
*DefaultPageRegion: A4
*PageRegion Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*PageRegion Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
*PageRegion A7/A7: "%% FoomaticRIPOptionSetting: PageSize=A7"
*PageRegion EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*PageRegion EnvISOB6/Envelope B6: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB6"
*PageRegion EnvISOB7/Envelope B7: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB7"
*PageRegion B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*PageRegion B6/B6 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B6"
*PageRegion B7/B7 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B7"
*PageRegion Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*PageRegion EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*PageRegion EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*PageRegion EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*PageRegion EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
*PageRegion EnvC7/Envelope C7: "%% FoomaticRIPOptionSetting: PageSize=EnvC7"
*CloseUI: *PageRegion

*DefaultPaperDimension: A4
*PaperDimension Letter/US Letter: "612 792"
*PaperDimension Executive/Executive: "522 756"
*PaperDimension Legal/US Legal: "612 1008"
*PaperDimension A4/A4: "595 842"
*PaperDimension A5/A5: "420 595"
*PaperDimension A6/A6: "298 420"
*PaperDimension A7/A7: "210 298"
*PaperDimension EnvISOB5/Envelope B5: "499 709"
*PaperDimension EnvISOB6/Envelope B6: "354 499"
*PaperDimension EnvISOB7/Envelope B7: "250 354"
*PaperDimension B5/B5 (JIS): "516 729"
*PaperDimension B6/B6 (JIS): "363 516"
*PaperDimension B7/B7 (JIS): "258 363"
*PaperDimension Env10/Envelope #10: "297 684"
*PaperDimension EnvDL/Envelope DL: "312 624"
*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
*PaperDimension EnvC5/Envelope C5: "459 649"
*PaperDimension EnvC6/Envelope C6: "323 459"
*PaperDimension EnvC7/Envelope C7: "230 323"

*DefaultImageableArea: A4
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea A5/A5: "18 36 402 559"
*ImageableArea A6/A6: "18 36 280 384"
*ImageableArea A7/A7: "18 36 192 262"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvISOB6/Envelope B6: "18 36 336 463"
*ImageableArea EnvISOB7/Envelope B7: "18 36 232 318"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea B6/B6 (JIS): "18 36 345 480"
*ImageableArea B7/B7 (JIS): "18 36 240 327"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvC6/Envelope C6: "18 36 305 423"
*ImageableArea EnvC7/Envelope C7: "18 36 212 287"

1
投票

如果你想在标准文件长度之外进行打印 例如打印到卷筒上

打开终端,或命令壳,或可选的windows bash提示符。

cd ..

cd ..

cd etc

cd cups

cd ppd

先安装vim或使用nano(程序文件编辑器)(vim有一个教程,只要输入vimtutor)

sudo vim Eastman_Kodak_Company_KODAK_ESP_3200_Series_AiO.ppd

滚动到最大高度宽度和自定义页面参数。

i 插入ESC 退出插入模式:wq! 保存和退出文件

请注意,宽度参数将被命名,或者按照宽度、高度的顺序排列。最大宽度参数应该保持不变,否则会影响打印机的对齐方式,但你可以将长度设置为任何长度,我相信。然后,你的打印机不会在页面设置中创建长度边界,并允许你连续循环打印,没有边距。确保您的纸张长度根据您的页面布局进行切割,否则它将简单地吐出卷的其余部分.这是我第一次尝试它,我不小心改变了宽度paramaters,我相信这是712。

enter image description here


0
投票

我有一台三星打印机,所以我下载了SpliX驱动程序的源代码。驱动程序的源码中包含了一个Makefile,可以从源码中编译.ppd,更简洁地列出可用的页面尺寸。现在,缺失的纸张尺寸显示在打印对话框的选项中。

这并没有解决我在小纸上打印的问题。我在自定义纸张大小方面的真正问题可能与应用程序与杯子对话的方式有关,以及在Ubuntu 9.04中,杯子的首选页面输入从.ps切换到.pdf......)

© www.soinside.com 2019 - 2024. All rights reserved.