将自定义页面尺寸添加到 .ppd 的最简单方法是什么?
我想将自定义页面尺寸添加到打印机的 .ppd(PostScript 打印机定义)文件中。 我需要添加什么才能使新的页面大小正常工作?
I would like to add custom page sizes to my printer's .ppd (PostScript printer definition) file. What do I have to add to get a new page size working properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您必须在 4 个不同位置为每个附加页面大小添加值:
PageSize
、PageRegion
、ImageableArea
和PaperDimension最好
,您采取一个 PPD 并搜索包含在这些关键字中的部分:
开头的部分
以及以“使用您在其中找到的行作为新条目的模板” 。 请注意,尺寸以 PostScript 点给出(其中 72pt == 1inch == 2.54cm)。
注意事项:
cupstestppd
实用程序(在 Linux 和 Mac OS X 上可用)检查 PPD。更新
关于使用
cupstestppd
测试 PPD 的:默认情况下,即使发现一些“不太重要”的语法问题,也会将错误报告为
**FAIL**
PPD 字符串翻译、过滤器、UIConstraints、配置文件、介质尺寸)。 您可以稍微放松这些严格的检查,并使用-W all
来将所有这些仅报告为警告,而不是错误:如果这返回显示
WARN size ...
的行> 您应该密切关注它们并确保修复 PPD。You have to add values for each additional page size at 4 different places:
PageSize
,PageRegion
,ImageableArea
andPaperDimension
Best, you take one PPD and search for sections enclosed in these keywords:
and for the sections starting with
Use the lines you find in there as templates for your new entries. Note, that dimensions are given in PostScript points (where 72pt ≡ 1inch ≡ 2.54cm).
Caveats:
cupstestppd
utility (available on Linux and on Mac OS X).Update
Regarding testing the PPD with
cupstestppd
:By default, this will report errors as
**FAIL**
even if it finds some "not-so-important" syntax issues (PPD string translations, filters, UIConstraints, profiles, media sizes). You can relax these strict checks a bit and use-W all
in order to report all these as warnings only, not as errors:If this returns lines saying
WARN size ...
you should pay close attention to them and make sure you fix the PPD.我有 HP LaserJet 1200。Foomatic/pxlmano 驱动程序提供的 PPD 文件缺少一些标准纸张尺寸。 我用以下语句更新了它:
I have HP LaserJet 1200. The PPD file provided by the Foomatic/pxlmono driver lacks some standard paper sizes. I updated it with the following statements:
如果您尝试打印超出标准文档长度,例如打印到卷筒上。
打开终端、命令 shell 或可选的 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。
If you're trying to print outside of the standard document length, for instance printing onto a roll.
open terminal, or command shell, or optional windows bash prompt
cd ..
cd ..
cd etc
cd cups
cd ppd
install vim first or use nano(program file editors)
(vim has a tutor just type vimtutor)
sudo vim Eastman_Kodak_Company_KODAK_ESP_3200_Series_AiO.ppd
scroll to the max height width and custom page params
i
to insertESC
to exit insert mode:wq!
to save and exit fileNote the width paramater will be named or in order of
width, height. The max width paramater should stay the same or it will throw the printers alignment off, but you can set the length to anything I believe. Then your printer will not create length boundaries in page setup and will allow you to print in continuous loop with no margin. Make sure your paper length is cut according to your page layout or it will simply spit out the rest of the roll.
This was my first try at it and I accidentally changed the width paramaters which were 712 I believe.
我有一台三星打印机,所以我下载了 SpliX 驱动程序的源代码。 驱动程序源代码包含一个 Makefile,用于从更简洁地列出可用页面大小的源代码编译 .ppd。 现在,缺少的纸张尺寸显示在打印对话框的选项中。
(这并没有解决我在小纸张上打印的问题。我的自定义纸张尺寸的真正问题可能与应用程序与 cups 通信的方式以及从 .ps 切换到 .pdf 作为 Ubuntu 9.04 中 cups 的首选页面输入有关...)
I have a Samsung printer so I downloaded the source code to the SpliX drivers. The driver source includes a Makefile to compile .ppd from sources that list the available page sizes much more succinctly. Now that missing paper size shows up in the print dialog's options.
(That did not solve my problem printing onto small paper. My real problem with custom paper sizes likely has something to do with the way applications talk to cups and the switch from .ps to .pdf as the preferred page input to cups in Ubuntu 9.04...)