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

时间:2009-06-22 19:07:04

标签: printing cups ppd

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

4 个答案:

答案 0 :(得分:15)

您必须在4个不同的位置为每个额外的页面大小添加值:

  1. 代表PageSize
  2. 代表PageRegion
  3. 代表ImageableArea
  4. for PaperDimension
  5. 最好,您需要一个PPD并搜索这些关键字中包含的部分

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

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

    以及以

    开头的部分
    *DefaultImageableArea: ...
    

    *DefaultPaperDimension: ...
    

    使用您在其中找到的行作为新条目的模板。请注意,尺寸在PostScript点中给出(其中72pt == 1inch~ = 2.54cm)。

    注意事项:

    1. 在PPD中的4个位置添加新行。
    2. 确保为新媒体尺寸使用uniq名称。
    3. 确保您的PPD中没有任何语法错误。
    4. 完成后(或在编辑时),使用cupstestppd实用程序(在Linux和Mac OS X上提供)检查您的PPD。

    5. 更新

      关于使用cupstestppd测试PPD:

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

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

      如果这返回说WARN size ...的行,你应该密切注意它们,并确保修复PPD。

答案 1 :(得分:1)

我有HP LaserJet 1200.Foomatic / pxlmono驱动程序提供的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"

答案 2 :(得分: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!保存和退出文件

请注意,宽度参数将以或的顺序命名 宽度,高度。最大宽度参数应保持不变,否则会使打印机对齐,但是您可以将长度设置为任何我相信的值。这样,您的打印机将不会在页面设置中创建长度边界,并允许您连续循环打印而没有空白。确保根据页面布局裁切纸张长度,否则只会吐出其余的纸卷。 这是我的第一次尝试,我不小心更改了宽度参数,我相信是712。

enter image description here

答案 3 :(得分:0)

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

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