aboutsummaryrefslogtreecommitdiff
path: root/zh_CN.GB2312/books/handbook/printing/chapter.xml
diff options
context:
space:
mode:
Diffstat (limited to 'zh_CN.GB2312/books/handbook/printing/chapter.xml')
-rw-r--r--zh_CN.GB2312/books/handbook/printing/chapter.xml719
1 files changed, 326 insertions, 393 deletions
diff --git a/zh_CN.GB2312/books/handbook/printing/chapter.xml b/zh_CN.GB2312/books/handbook/printing/chapter.xml
index d4688e72fc..e0abc563b5 100644
--- a/zh_CN.GB2312/books/handbook/printing/chapter.xml
+++ b/zh_CN.GB2312/books/handbook/printing/chapter.xml
@@ -6,30 +6,20 @@
Original Revision: 1.123
$FreeBSD$
-->
-
-<chapter id="printing">
- <chapterinfo>
+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="printing">
+ <info><title>打印</title>
<authorgroup>
- <author>
- <firstname>Sean</firstname>
- <surname>Kelly</surname>
- <contrib>Contributed by </contrib>
- </author>
+ <author><personname><firstname>Sean</firstname><surname>Kelly</surname></personname><contrib>Contributed by </contrib></author>
<!-- 30 Sept 1995 -->
</authorgroup>
<authorgroup>
- <author>
- <firstname>Jim</firstname>
- <surname>Mock</surname>
- <contrib>Restructured and updated by </contrib>
- <!-- Mar 2000 -->
- </author>
+ <author><personname><firstname>Jim</firstname><surname>Mock</surname></personname><contrib>Restructured and updated by </contrib></author>
</authorgroup>
- </chapterinfo>
+ </info>
- <title>打印</title>
+
- <sect1 id="printing-synopsis">
+ <sect1 xml:id="printing-synopsis">
<title>概述</title>
<indexterm><primary>LPD spooling system</primary></indexterm>
<indexterm><primary>printing</primary></indexterm>
@@ -91,7 +81,7 @@
</itemizedlist>
</sect1>
- <sect1 id="printing-intro-spooler">
+ <sect1 xml:id="printing-intro-spooler">
<title>介绍</title>
<para>为了在 &os; 中使用打印机,
@@ -102,8 +92,7 @@
并且将指导您完成其配置。</para>
<para>如果您已经熟悉了
- <application>LPD</application> 或者其他后台打印系统, 则可以跳到 <link
- linkend="printing-intro-setup">设置后台打印系统</link> 这部分。</para>
+ <application>LPD</application> 或者其他后台打印系统, 则可以跳到 <link linkend="printing-intro-setup">设置后台打印系统</link> 这部分。</para>
<para><application>LPD</application> 完全控制一台计算机上的打印机。
它负责许多的事情:</para>
@@ -152,7 +141,7 @@
您可以使<application>LPD</application>
系统在众多种类的打印机硬件上完成上面全部的或者一些子集的功能。</para>
- <sect2 id="printing-intro-why">
+ <sect2 xml:id="printing-intro-why">
<title>为什么要用后台打印</title>
<para>如果您是系统唯一的用户, 您可能会奇怪为什么要在您不需要访问控制,
@@ -179,13 +168,13 @@
</sect2>
</sect1>
- <sect1 id="printing-intro-setup">
+ <sect1 xml:id="printing-intro-setup">
<title>基本设置</title>
<warning>
<para>从 &os; 8.0 起, 串口对应的设备名由
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 变为
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 变为
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户应将这篇文档的示例中的设备名改为原先的样子。</para>
</warning>
@@ -212,7 +201,7 @@
</listitem>
</itemizedlist>
- <sect2 id="printing-simple">
+ <sect2 xml:id="printing-simple">
<title>简单打印机设置</title>
<para>这部分讲解怎样配置打印机硬件和
@@ -236,8 +225,7 @@
<para>如果您正在设置一台通过网络协议
接收数据来打印而不是通过串口或者并口的打印机,
- 参见 <link
- linkend="printing-advanced-network-net-if">使用网络数据流界面的打印机</link>。</para>
+ 参见 <link linkend="printing-advanced-network-net-if">使用网络数据流界面的打印机</link>。</para>
<para>尽管这部分叫<quote>简单打印机
设置</quote>, 但还是相当复杂的。 使打印机
@@ -246,7 +234,7 @@
部分。 一旦您的打印机可以正常工作后,那些高级选项, 比如报文页和记帐,
是相当简单的。</para>
- <sect3 id="printing-hardware">
+ <sect3 xml:id="printing-hardware">
<title>硬件设置</title>
<para>这部分讲述了打印机连接到计算机的多种
@@ -256,10 +244,9 @@
<para>如果您已经连接好了您的打印机而且已经
用它在另外一个操作系统下成功的打印, 您
- 或许可以跳到这个部分<link
- linkend="printing-software">软件设置</link>。</para>
+ 或许可以跳到这个部分<link linkend="printing-software">软件设置</link>。</para>
- <sect4 id="printing-ports">
+ <sect4 xml:id="printing-ports">
<title>端口和连接电缆</title>
<para>现在所出售的在 PC 上使用的打印机通常至少有
@@ -346,7 +333,7 @@
将打印前后得到的两个值相减就可以得到该用户要付多少纸钱。</para>
</sect4>
- <sect4 id="printing-parallel">
+ <sect4 xml:id="printing-parallel">
<title>并口</title>
<para>用并口连接打印机需要用 Centronics
@@ -356,15 +343,15 @@
<para>记住您用的计算机上的哪个并口。
第一个并口在 &os; 上叫
- <filename class="devicefile">/dev/ppc0</filename>;
+ <filename>/dev/ppc0</filename>;
第二个叫
- <filename class="devicefile">/dev/ppc1</filename>,
+ <filename>/dev/ppc1</filename>,
依此类推。打印机设备也用同样的方法命名:
- <filename class="devicefile">/dev/lpt0</filename>
+ <filename>/dev/lpt0</filename>
是接在第一个并口上的打印机, 依此类推。</para>
</sect4>
- <sect4 id="printing-serial">
+ <sect4 xml:id="printing-serial">
<title>串口</title>
<para>用串口连接打印机需要用
@@ -419,7 +406,7 @@
</sect4>
</sect3>
- <sect3 id="printing-software">
+ <sect3 xml:id="printing-software">
<title>软件设置</title>
<para>这部分描述了要使用 &os; 系统中的
@@ -431,15 +418,13 @@
<procedure>
<step>
<para>在需要的时候配置内核来允许您连接
- 打印机的端口; <link
- linkend="printing-kernel">配置内核</link> 部分会告诉您
+ 打印机的端口; <link linkend="printing-kernel">配置内核</link> 部分会告诉您
需要做什么。</para>
</step>
<step>
<para>如果您使用并口, 则需要设置一下
- 并口的通讯模式; <link
- linkend="printing-parallel-port-mode">设置
+ 并口的通讯模式; <link linkend="printing-parallel-port-mode">设置
并口通讯模式</link> 部分会告诉您具体的
细节。</para>
</step>
@@ -459,7 +444,7 @@
</step>
</procedure>
- <sect4 id="printing-kernel">
+ <sect4 xml:id="printing-kernel">
<title>配置内核</title>
<para>操作系统的内核为了使某些特殊设备工作需要重新
@@ -471,7 +456,7 @@
<para>要想知道您现在使用的内核是否支持串口,
输入:</para>
- <screen>&prompt.root; <userinput><command>grep sio<replaceable>N</replaceable> <filename>/var/run/dmesg.boot</filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>grep sioN /var/run/dmesg.boot</userinput></screen>
<para>其中 <replaceable>N</replaceable> 是串口的
编号, 从0开始。 如果您看到
@@ -485,7 +470,7 @@ sio2: type 16550A</screen>
<para>要想知道您现在使用的内核是否支持并口,
输入:</para>
- <screen>&prompt.root; <userinput><command>grep ppc<replaceable>N</replaceable> /var/run/dmesg.boot</command></userinput></screen>
+ <screen>&prompt.root; <userinput>grep ppcN /var/run/dmesg.boot</userinput></screen>
<para>其中 <replaceable>N</replaceable> 是并口的
编号, 同样从0开始。 如果得到类似
@@ -508,7 +493,7 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
</sect4>
</sect3>
- <sect3 id="printing-parallel-port-mode">
+ <sect3 xml:id="printing-parallel-port-mode">
<title>设置并口的通讯模式</title>
<para>在使用并口时, 您可以选择
@@ -587,8 +572,7 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
<step>
<para>保存文件。 然后配置, 建立, 并安装刚配置的内核,
- 最后重新启动。 参见 <link
- linkend="kernelconfig">内核配置</link> 这章来获得更多细节。</para>
+ 最后重新启动。 参见 <link linkend="kernelconfig">内核配置</link> 这章来获得更多细节。</para>
</step>
</procedure>
@@ -599,19 +583,19 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
<step>
<para>输入:</para>
- <screen>&prompt.root; <userinput><command>lptcontrol <option>-i</option> <option>-d</option> <filename class="devicefile">/dev/lpt<replaceable>N</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>lptcontrol -i -d /dev/lptN</userinput></screen>
<para>将
- <literal>lpt<replaceable>N</replaceable></literal> 设置成中断方式。</para>
+ <literal>lptN</literal> 设置成中断方式。</para>
</step>
<step>
<para>输入:</para>
- <screen>&prompt.root; <userinput><command>lptcontrol <option>-p</option> <option>-d</option> <filename class="devicefile">/dev/lpt<replaceable>N</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>lptcontrol -p -d /dev/lptN</userinput></screen>
<para>将
- <literal>lpt<replaceable>N</replaceable></literal> 设置成轮询方式。</para>
+ <literal>lptN</literal> 设置成轮询方式。</para>
</step>
</procedure>
@@ -621,7 +605,7 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
更多信息。</para>
</sect3>
- <sect3 id="printing-testing">
+ <sect3 xml:id="printing-testing">
<title>检测打印机的通讯</title>
<para>在设置后台打印系统之前,
@@ -657,7 +641,7 @@ showpage</programlisting>
所以需要对这类打印机语言进行特殊的处理。</para>
</note>
- <sect4 id="printing-checking-parallel">
+ <sect4 xml:id="printing-checking-parallel">
<title>检测并口打印机</title>
<indexterm>
@@ -671,7 +655,7 @@ showpage</programlisting>
<procedure>
<step>
- <para>用 &man.su.1; 命令转换到 <username>root</username> 用户。</para>
+ <para>用 &man.su.1; 命令转换到 <systemitem class="username">root</systemitem> 用户。</para>
</step>
<step>
@@ -682,7 +666,7 @@ showpage</programlisting>
<para>如果打印机可以直接打印纯文本, 可以用
&man.lptest.1;。 输入:</para>
- <screen>&prompt.root; <userinput><command>lptest &gt; <filename class="devicefile">/dev/lpt<replaceable>N</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>lptest &gt; /dev/lptN</userinput></screen>
<para>其中 <replaceable>N</replaceable>
是并口的编号, 从0开始。</para>
@@ -692,7 +676,7 @@ showpage</programlisting>
<para>如果打印机支持 &postscript; 或其他打印机语言,
可以发送一段小程序到打印机。 输入:</para>
- <screen>&prompt.root; <userinput><command>cat &gt; <filename class="devicefile">/dev/lpt<replaceable>N</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>cat &gt; /dev/lptN</userinput></screen>
<para>然后, 一行一行地 <emphasis>输入</emphasis>
@@ -705,7 +689,7 @@ showpage</programlisting>
<para>另外一种办法,
您可以把这段程序写在一个文件里, 并输入:</para>
- <screen>&prompt.root; <userinput><command>cat <filename><replaceable>file</replaceable></filename> &gt; <filename class="devicefile">/dev/lpt<replaceable>N</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>cat file &gt; /dev/lptN</userinput></screen>
<para>其中 <replaceable>file</replaceable>
是包含这您要发给打印机程序的文件名。</para>
@@ -719,7 +703,7 @@ showpage</programlisting>
我们将在后面指导您如何解决这类问题。</para>
</sect4>
- <sect4 id="printing-checking-serial">
+ <sect4 xml:id="printing-checking-serial">
<title>检测串口打印机</title>
<indexterm>
@@ -733,14 +717,14 @@ showpage</programlisting>
<procedure>
<step>
- <para>通过 &man.su.1; 命令转为 <username>root</username> 用户。</para>
+ <para>通过 &man.su.1; 命令转为 <systemitem class="username">root</systemitem> 用户。</para>
</step>
<step>
<para>修改 <filename>/etc/remote</filename> 这个文件。
增加下面这些内容:</para>
- <programlisting>printer:dv=<filename class="devicefile">/dev/<replaceable>port</replaceable></filename>:br#<replaceable>bps-rate</replaceable>:pa=<replaceable>parity</replaceable></programlisting>
+ <programlisting>printer:dv=<filename>/dev/port</filename>:br#<replaceable>bps-rate</replaceable>:pa=<replaceable>parity</replaceable></programlisting>
<indexterm><primary>bits-per-second</primary></indexterm>
<indexterm><primary>serial port</primary></indexterm>
@@ -759,20 +743,20 @@ showpage</programlisting>
它连接在第三个串口上, 速度为 19200 &nbsp; 波特,
不进行校验:</para>
- <programlisting>printer:dv=<filename class="devicefile">/dev/ttyu2</filename>:br#19200:pa=none</programlisting>
+ <programlisting>printer:dv=<filename>/dev/ttyu2</filename>:br#19200:pa=none</programlisting>
</step>
<step>
<para>用 &man.tip.1; 连接打印机。
输入:</para>
- <screen>&prompt.root; <userinput><command>tip</command> printer</userinput></screen>
+ <screen>&prompt.root; <userinput>tip printer</userinput></screen>
<para>如果没能成功, 则要再次修改
<filename>/etc/remote</filename> 这个文件, 并且试试用
- <filename class="devicefile">/dev/cuaa<replaceable>N</replaceable></filename>
+ <filename>/dev/cuaaN</filename>
代替
- <filename class="devicefile">/dev/ttyd<replaceable>N</replaceable></filename>。</para>
+ <filename>/dev/ttydN</filename>。</para>
</step>
<step>
@@ -800,7 +784,7 @@ showpage</programlisting>
<para>或者, 您同样也可以把程序存储在一个文件里
并输入:</para>
- <screen>&prompt.user; <userinput>&gt;<replaceable>file</replaceable></userinput></screen>
+ <screen>&prompt.user; <userinput>&gt;file</userinput></screen>
<para>其中 <replaceable>file</replaceable> 是
包含要发送程序的文件名。 在
@@ -817,7 +801,7 @@ showpage</programlisting>
</sect4>
</sect3>
- <sect3 id="printing-printcap">
+ <sect3 xml:id="printing-printcap">
<title>启用后台打印: 文件 <filename>/etc/printcap</filename>
</title>
@@ -865,34 +849,29 @@ showpage</programlisting>
<step>
<para>建立一个后台打印队列的目录, 并且通过
- <literal>sd</literal> 项目指定它的位置; 您可参见 <link
- linkend="printing-spooldir">创建后台打印队列目录</link>
+ <literal>sd</literal> 项目指定它的位置; 您可参见 <link linkend="printing-spooldir">创建后台打印队列目录</link>
一节了解更多信息。</para>
</step>
<step>
- <para>在 <filename class="directory">/dev</filename> 下设置打印机设备节点,
+ <para>在 <filename>/dev</filename> 下设置打印机设备节点,
并且在写在 <filename>/etc/printcap</filename>
- 文件中 <literal>lp</literal> 项目里; 参见 <link
- linkend="printing-device">识别打印机设备</link>
+ 文件中 <literal>lp</literal> 项目里; 参见 <link linkend="printing-device">识别打印机设备</link>
这部分可以得到更多信息。 此外, 如果打印机连接在串口上,
通讯参数的设置需要写在
- <literal>ms#</literal> 项中。 这些参数在 <link
- linkend="printing-commparam">配置后台打印通讯参数</link>
+ <literal>ms#</literal> 项中。 这些参数在 <link linkend="printing-commparam">配置后台打印通讯参数</link>
这在前面已经讨论过。</para>
</step>
<step>
- <para>安装纯文本过滤器; 详情请参见 <link
- linkend="printing-textfilter">安装文本过滤器</link> 小节。</para>
+ <para>安装纯文本过滤器; 详情请参见 <link linkend="printing-textfilter">安装文本过滤器</link> 小节。</para>
</step>
<step>
<para>用
&man.lpr.1; 命令来测试设置。 想得到更多信息可以参见
<link linkend="printing-trying">测试</link> 和
- <link
- linkend="printing-troubleshooting">故障排除</link>
+ <link linkend="printing-troubleshooting">故障排除</link>
部分。</para>
</step>
</procedure>
@@ -911,11 +890,10 @@ showpage</programlisting>
<emphasis>而且</emphasis> 还能打印纯文本的任务的话,
那么强烈建议您在上面提到的简单设置的步骤上增加一步:
安装从自动纯文本到 &postscript; (或者其他打印机语言)
- 的转换程序。 更多的细节, 请参见 <link
- linkend="printing-advanced-if-conversion">在
+ 的转换程序。 更多的细节, 请参见 <link linkend="printing-advanced-if-conversion">在
&postscript; 打印机上打印纯文本</link>。</para>
- <sect4 id="printing-naming">
+ <sect4 xml:id="printing-naming">
<title>打印机的命名</title>
<para>第一步 (简单) 就是给打印机起一个名字。
@@ -961,7 +939,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:</programlisting>
<literal>Panasonic KX-P4455 PostScript v51.4</literal> 这几个别名。</para>
</sect4>
- <sect4 id="printing-no-header-pages">
+ <sect4 xml:id="printing-no-header-pages">
<title>不打印报头页</title>
<indexterm>
<primary>printing</primary>
@@ -997,7 +975,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
一行写不下需要换行时, 在换行前打一个反斜杠。</para>
</sect4>
- <sect4 id="printing-spooldir">
+ <sect4 xml:id="printing-spooldir">
<title>建立后台打印队列目录</title>
<indexterm><primary>printer spool</primary></indexterm>
<indexterm><primary>print jobs</primary></indexterm>
@@ -1009,7 +987,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>由于后台打印队列目录的变量本质, 通常
把这些目录安排在
- <filename class="directory">/var/spool</filename> 下。 您也没有必要去
+ <filename>/var/spool</filename> 下。 您也没有必要去
备份后台打印队列目录里的内容。
重新建立它们只要简单的使用 &man.mkdir.1; 命令。</para>
@@ -1017,7 +995,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
打印机一样的名字, 像下面
这样:</para>
- <screen>&prompt.root; <userinput><command>mkdir <filename class="directory">/var/spool/<replaceable>printer-name</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>mkdir /var/spool/printer-name</userinput></screen>
<para>然而, 如果您有很多网络打印机,
您可能想要把这些后台打印的队列目录目录放在一个单独的专为使用
@@ -1026,22 +1004,22 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<literal>rattan</literal> 和
<literal>bamboo</literal> 作为例子:</para>
- <screen>&prompt.root; <userinput><command>mkdir <filename class="directory">/var/spool/lpd</filename></command></userinput>
-&prompt.root; <userinput><command>mkdir <filename class="directory">/var/spool/lpd/rattan</filename></command></userinput>
-&prompt.root; <userinput><command>mkdir <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>mkdir /var/spool/lpd</userinput>
+&prompt.root; <userinput>mkdir /var/spool/lpd/rattan</userinput>
+&prompt.root; <userinput>mkdir /var/spool/lpd/bamboo</userinput></screen>
<note>
<para>如果担心用户任务的保密性,
可能会希望保护相应的后台打印队列目录, 使之不能被其他用户访问。
后台打印的队列目录的属主应该是 daemon 用户,
- 而 <username>daemon</username> 用户和 <groupname>daemon</groupname>
+ 而 <systemitem class="username">daemon</systemitem> 用户和 <systemitem class="groupname">daemon</systemitem>
组拥有读写和搜索的权限,但其他用户没有。
接下来用我们的两台打印机作为例子:</para>
- <screen>&prompt.root; <userinput><command>chown daemon:daemon <filename class="directory">/var/spool/lpd/rattan</filename></command></userinput>
-&prompt.root; <userinput><command>chown daemon:daemon <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput>
-&prompt.root; <userinput><command>chmod 770 <filename class="directory">/var/spool/lpd/rattan</filename></command></userinput>
-&prompt.root; <userinput><command>chmod 770 <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>chown daemon:daemon /var/spool/lpd/rattan</userinput>
+&prompt.root; <userinput>chown daemon:daemon /var/spool/lpd/bamboo</userinput>
+&prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan</userinput>
+&prompt.root; <userinput>chmod 770 /var/spool/lpd/bamboo</userinput></screen>
</note>
<para>最后, 您需要通过<filename>/etc/printcap</filename> 文件告诉 <application>LPD</application>
@@ -1051,30 +1029,30 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
# /etc/printcap for host rose - added spooling directories
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:</programlisting>
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:</programlisting>
<para>注意打印机的名字要从第 1 列开始, 其他记录每行都要用
TAB 键缩进一次, 写不开需要换行在最后加上反斜杠。</para>
<para>如果您没用
<literal>sd</literal> 标记指定后台打印队列目录, 后台打印系统会将
- <filename class="directory">/var/spool/lpd</filename> 目录作为默认目录。</para>
+ <filename>/var/spool/lpd</filename> 目录作为默认目录。</para>
</sect4>
- <sect4 id="printing-device">
+ <sect4 xml:id="printing-device">
<title>识别打印机设备</title>
<para>在 <link linkend="printing-hardware">Hardware Setup</link>
一节中,我们说明了 &os; 与打印机通讯将使用哪个端口和
- <filename class="directory">/dev</filename> 目录下的节点。
+ <filename>/dev</filename> 目录下的节点。
我们要告诉 <application>LPD</application> 这些信息。
当后台打印系统有任务需要打印,它将为过滤程序
(负责传送数据到打印机) 打开指定的设备。</para>
- <para>用 <literal>lp</literal> 标记在 <filename>/etc/printcap</filename> 里列出 <filename class="directory">/dev</filename>
+ <para>用 <literal>lp</literal> 标记在 <filename>/etc/printcap</filename> 里列出 <filename>/dev</filename>
下的设备节点。</para>
<para>在我们的例子中, 假设打印机
@@ -1086,28 +1064,27 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
# /etc/printcap for host rose - identified what devices to use
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:</programlisting>
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:\
+ :lp=<filename>/dev/ttyu5</filename>:</programlisting>
<para>如果您没在您的 <filename>/etc/printcap</filename> 文件中
用 <literal>lp</literal> 标记指定设备节点,
- <application>LPD</application> 将默认使用 <filename class="devicefile">/dev/lp</filename>
+ <application>LPD</application> 将默认使用 <filename>/dev/lp</filename>
- <filename class="devicefile">/dev/lp</filename> 目前在
+ <filename>/dev/lp</filename> 目前在
&os; 中不存在。</para>
<para>如果您正在安装的打印机是连接在
- 并口上的, 请跳到 <link
- linkend="printing-textfilter">安装文本
+ 并口上的, 请跳到 <link linkend="printing-textfilter">安装文本
过滤器</link> 这章。 如果不是的话, 还是最好按下面介绍的
步骤做。</para>
</sect4>
- <sect4 id="printing-commparam">
+ <sect4 xml:id="printing-commparam">
<title>配置后台打印通讯参数</title>
<indexterm>
<primary>printers</primary>
@@ -1141,7 +1118,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<variablelist>
<varlistentry>
- <term><literal>br#<replaceable>bps-rate</replaceable></literal></term>
+ <term><literal>br#bps-rate</literal></term>
<listitem>
<para>设置设备的通讯速度为
@@ -1153,7 +1130,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
</varlistentry>
<varlistentry>
- <term><literal>ms#<replaceable>stty-mode</replaceable></literal></term>
+ <term><literal>ms#stty-mode</literal></term>
<listitem>
<para>设置已打开的中端设备的选项
@@ -1183,11 +1160,11 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
用 <literal>crtscts</literal> 设置成硬件流量控制:</para>
<programlisting>bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:</programlisting>
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:</programlisting>
</sect4>
- <sect4 id="printing-textfilter">
+ <sect4 xml:id="printing-textfilter">
<title>安装文本过滤器</title>
<indexterm>
<primary>printing</primary>
@@ -1218,8 +1195,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
使那些可能不能很好处理这类字符流的打印机正常工作。
而且, 当然, 您可以用任何其他的
您想用的过滤程序。 <command>lpf</command> 过滤器在
- <link
- linkend="printing-advanced-lpf">lpf: 一个文本
+ <link linkend="printing-advanced-lpf">lpf: 一个文本
过滤器</link> 这节将有详细描述。</para>
<para>首先, 我们来写一段叫做
@@ -1239,7 +1215,7 @@ exit 2</programlisting>
<para>使这个文件可以被执行:</para>
- <screen>&prompt.root; <userinput><command>chmod 555 <filename>/usr/local/libexec/if-simple</filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>chmod 555 /usr/local/libexec/if-simple</userinput></screen>
<para>然后用
<literal>if</literal> 标记在
@@ -1251,17 +1227,16 @@ exit 2</programlisting>
# /etc/printcap for host rose - added text filter
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\ :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:\
:if=<filename>/usr/local/libexec/if-simple</filename>:</programlisting>
<note>
- <para><filename>if-simple</filename> 脚本的副本可以在 <filename
- class="directory">/usr/share/examples/printing</filename>
+ <para><filename>if-simple</filename> 脚本的副本可以在 <filename>/usr/share/examples/printing</filename>
目录中找到。</para>
</note>
</sect4>
@@ -1279,10 +1254,10 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>到 <filename>/etc/rc.conf</filename> 文件当中, 然后既可以重启您的
机器, 也可以直接运行 &man.lpd.8;。</para>
- <screen>&prompt.root; <userinput><command>lpd</command></userinput></screen>
+ <screen>&prompt.root; <userinput>lpd</userinput></screen>
</sect4>
- <sect4 id="printing-trying">
+ <sect4 xml:id="printing-trying">
<title>测试</title>
<para>现在已经基本完成了
@@ -1295,8 +1270,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
它可以提交一个任务来打印。</para>
<para>您可以联合使用 &man.lpr.1; 和 &man.lptest.1;
- 程序, 在 <link
- linkend="printing-testing">检查打印机
+ 程序, 在 <link linkend="printing-testing">检查打印机
通讯</link> 这节介绍怎样生成一些测试文本。</para>
<para><emphasis>要测试简单 <application>LPD</application>
@@ -1304,7 +1278,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>输入:</para>
- <screen>&prompt.root; <userinput><command>lptest 20 5 | lpr <option>-P</option><replaceable>printer-name</replaceable></command></userinput></screen>
+ <screen>&prompt.root; <userinput>lptest 20 5 | lpr -Pprinter-name</userinput></screen>
<para>其中 <replaceable>printer-name</replaceable> 是
在 <filename>/etc/printcap</filename> 中指定的打印机的一个名字 ( 或者一个别名)
@@ -1314,7 +1288,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
&postscript; 的打印机, 发送一个 &postscript; 程序到打印机而不是
使用 &man.lptest.1;。 您可以把程序放在一个
文件里, 然后输入: <command>lpr
- <replaceable>file</replaceable></command>。</para>
+ file</command>。</para>
<para>对于一台 &postscript; 打印机, 您应该得到那段程序的
结果。 而如果您使用的 &man.lptest.1;, 则您得到的
@@ -1332,21 +1306,20 @@ $%&amp;'()*+,-./01234567
<command>lptest 80 60</command> 将生成 60 行 每行 80
个字符。</para>
- <para>如果打印机不能工作, 参考 <link
- linkend="printing-troubleshooting">故障排除</link>
+ <para>如果打印机不能工作, 参考 <link linkend="printing-troubleshooting">故障排除</link>
这节。</para>
</sect4>
</sect3>
</sect2>
</sect1>
- <sect1 id="printing-advanced">
+ <sect1 xml:id="printing-advanced">
<title>高级设置</title>
<warning>
<para>从 &os; 8.0 起, 串口对应的设备名由
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 变为
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 变为
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户应将这篇文档的示例中的设备名改为原先的样子。</para>
</warning>
@@ -1354,7 +1327,7 @@ $%&amp;'()*+,-./01234567
页眉, 通过网络打印, 以及对打印机使用限制和
记帐。</para>
- <sect2 id="printing-advanced-filter-intro">
+ <sect2 xml:id="printing-advanced-filter-intro">
<title>过滤器</title>
<indexterm>
<primary>printing</primary>
@@ -1403,8 +1376,7 @@ $%&amp;'()*+,-./01234567
<listitem>
<para><application>LPD</application> 假定任何打印机在默认状态下均能打印纯文本内容。
对于不能直接打印纯文本的 &postscript; 打印机 (以及其他基于打印语言的打印机)
- 而言这会带来问题。 在 <link
- linkend="printing-advanced-if-conversion">在 &postscript; 打印机上使用纯文本任务</link>
+ 而言这会带来问题。 在 <link linkend="printing-advanced-if-conversion">在 &postscript; 打印机上使用纯文本任务</link>
这节中将会介绍如何解决这个问题的方法。 如果您使用
&postscript; 打印机, 就应阅读这节内容。</para>
</listitem>
@@ -1412,8 +1384,7 @@ $%&amp;'()*+,-./01234567
<listitem>
<para>&postscript; 对于许多程序来说都是一个非常受欢迎的输出格式。
一些人甚至直接写 &postscript; 代码。 但不幸的是,
- &postscript; 打印机非常昂贵。 <link
- linkend="printing-advanced-ps">模拟 &postscript; 在
+ &postscript; 打印机非常昂贵。 <link linkend="printing-advanced-ps">模拟 &postscript; 在
非 &postscript; 打印机上</link> 这节将告诉您怎样进一步修改
打印机的文本过滤器, 使得一台 <emphasis>非 &postscript;</emphasis> 打印机接受
并打印 &postscript; 数据。 如果
@@ -1421,16 +1392,15 @@ $%&amp;'()*+,-./01234567
</listitem>
<listitem>
- <para><link
- linkend="printing-advanced-convfilters">转换过滤器</link>
+ <para><link linkend="printing-advanced-convfilters">转换过滤器</link>
这节讲述了一个自动把指定格式文件, 比如图像或排版数据,
转换成您打印机可以理解的格式的方法。 在阅读了这节之后,
您就应该可以配置打印机, 让用户可以用
- <command>lpr <option>-t</option></command>
+ <command>lpr -t</command>
来打印 troff 数据、 用
- <command>lpr <option>-d</option></command>
+ <command>lpr -d</command>
来打印 &tex; DVI 数据, 或用
- <command>lpr <option>-v</option></command>
+ <command>lpr -v</command>
来打印光栅图像数据等工作了。 建议您阅读这节。</para>
</listitem>
@@ -1438,8 +1408,7 @@ $%&amp;'()*+,-./01234567
<para><link linkend="printing-advanced-of">输出
过滤器</link> 这节讲述了这个不是经常使用的
<application>LPD</application>:
- 的功能-输出过滤器。 除非您要打印页眉 (见 <link
- linkend="printing-advanced-header-pages">页眉</link> 这节 ),
+ 的功能-输出过滤器。 除非您要打印页眉 (见 <link linkend="printing-advanced-header-pages">页眉</link> 这节 ),
您或许可以完全跳过这节。</para>
</listitem>
@@ -1455,12 +1424,11 @@ $%&amp;'()*+,-./01234567
</itemizedlist>
<note>
- <para>您可以在 <filename
- class="directory">/usr/share/examples/printing</filename>
+ <para>您可以在 <filename>/usr/share/examples/printing</filename>
目录中找到下面将提到的那些脚本的副本。</para>
</note>
- <sect3 id="printing-advanced-filters">
+ <sect3 xml:id="printing-advanced-filters">
<title>过滤器是怎样工作的</title>
<para>前面说过, 过滤器是一个被
@@ -1473,7 +1441,7 @@ $%&amp;'()*+,-./01234567
标准输出设置成打印机, 并且把错误信息定向到
错误日志文件 (在 <literal>lf</literal>
标识里指定, 默认在 <filename>/etc/printcap</filename>, 或者
- <filename class="devicefile">/dev/console</filename> 文件里 )。</para>
+ <filename>/dev/console</filename> 文件里 )。</para>
<indexterm>
<primary><command>troff</command></primary>
@@ -1482,12 +1450,11 @@ $%&amp;'()*+,-./01234567
并且过滤器的参数依赖于 <filename>/etc/printcap</filename>
文件中所列出的和用户为任务用
&man.lpr.1; 命令所指定的。 例如, 如果用户输入
- <command>lpr <option>-t</option></command>,
+ <command>lpr -t</command>,
<application>LPD</application> 会启动 troff 过滤器,
即在目标打印机的 <literal>tf</literal> 标签里所列出的过滤器。
如果用户想要打印纯文本, 它将会启动
- <literal>if</literal> 过滤器 (这是通常的情况: 参见 <link
- linkend="printing-advanced-of">输出过滤器</link> 来得到
+ <literal>if</literal> 过滤器 (这是通常的情况: 参见 <link linkend="printing-advanced-of">输出过滤器</link> 来得到
细节)。</para>
<para>在
@@ -1527,7 +1494,7 @@ $%&amp;'()*+,-./01234567
<listitem>
<para>当任务用 <command>lpr
- <option>-l</option></command> 这个命令提交时出现 </para>
+ -l</command> 这个命令提交时出现 </para>
</listitem>
</varlistentry>
@@ -1554,7 +1521,7 @@ $%&amp;'()*+,-./01234567
<listitem>
<para>这里是来自 <command>lpr
- <option>-i</option></command> 命令的总缩进量, 默认为 0</para>
+ -i</command> 命令的总缩进量, 默认为 0</para>
</listitem>
</varlistentry>
@@ -1595,15 +1562,13 @@ $%&amp;'()*+,-./01234567
将特定格式的文件转换成打印机能够识别并打印的格式。
例如, ditroff 格式的排版数据就是无法直接打印的,
但您可以安装一个转换过滤器来将 ditroff
- 文件转换成一种打印机可以识别和打印的形式。 请参见 <link
- linkend="printing-advanced-convfilters">转换过滤器</link>
+ 文件转换成一种打印机可以识别和打印的形式。 请参见 <link linkend="printing-advanced-convfilters">转换过滤器</link>
这一节来了解更多细节。 如果您需要对打印进行记帐,
那么转换过滤器也必须完成记帐工作。 转换过虑器的启动命令为:</para>
<cmdsynopsis>
<command>filter-name</command>
- <arg
- choice="plain">-x <replaceable>pixel-width</replaceable></arg>
+ <arg choice="plain">-x <replaceable>pixel-width</replaceable></arg>
<arg choice="plain">-y <replaceable>pixel-height</replaceable></arg>
<arg choice="plain">-n <replaceable>login</replaceable></arg>
<arg choice="plain">-h <replaceable>host</replaceable></arg>
@@ -1619,8 +1584,7 @@ $%&amp;'()*+,-./01234567
<listitem>
<para><emphasis> 输出过滤器 </emphasis> 仅在没有文本过滤器时,
或者报头页被打开时使用。 就我们的经验而言,
- 输出过滤器是很少用到的. 在 <link
- linkend="printing-advanced-of">输出过滤器</link> 这节中会介绍它们。
+ 输出过滤器是很少用到的. 在 <link linkend="printing-advanced-of">输出过滤器</link> 这节中会介绍它们。
启动输出过滤器的命令行只有两个参数:</para>
<cmdsynopsis>
@@ -1680,7 +1644,7 @@ $%&amp;'()*+,-./01234567
则同样需要使之支持前面那些参数和退出状态码。</para>
</sect3>
- <sect3 id="printing-advanced-if-conversion">
+ <sect3 xml:id="printing-advanced-if-conversion">
<title>在 &postscript; 打印机上打印纯文本任务</title>
<indexterm><primary>print jobs</primary></indexterm>
@@ -1720,8 +1684,8 @@ $%&amp;'()*+,-./01234567
<para><command>lprps</command> 可以在 &os; Ports Collection
(详见 <link linkend="ports">The Ports Collection</link>) 中找到。
你可以根据页面的尺寸选择安装
- <filename role="package">print/lprps-a4</filename>
- 和 <filename role="package">print/lprps-letter</filename>。
+ <package>print/lprps-a4</package>
+ 和 <package>print/lprps-letter</package>。
在安装了 <command>lprps</command> 之后, 只需指定
<command>psif</command> 这个程序的路径, 这也是包含在
<command>lprps</command> 中的一个程序。 如果您已经用 ports 安装好了
@@ -1770,7 +1734,7 @@ fi</programlisting>
<literal>a2ps</literal>。</para>
</sect3>
- <sect3 id="printing-advanced-ps">
+ <sect3 xml:id="printing-advanced-ps">
<title>模拟 &postscript; 在非 &postscript; 打印机上</title>
<indexterm>
<primary>PostScript</primary>
@@ -1793,7 +1757,7 @@ fi</programlisting>
<para><application>Ghostscript</application> 被收录在
&os; Ports Collection 中,有许多可用的版本,
比较常用的版本是
- <filename role="package">print/ghostscript-gpl</filename>。</para>
+ <package>print/ghostscript-gpl</package>。</para>
<para>要模拟 &postscript;, 文本过滤器要检测是否要打印一个
&postscript; 文件。 如果不是, 那么过滤器将直接将文件发送到打印机;
@@ -1804,7 +1768,7 @@ fi</programlisting>
Hewlett Packard DeskJet 500 打印机的文本过滤器。 对于其他打印机,
替换 <command>gs</command> (<application>Ghostscript</application>)
命令中的 <option>-sDEVICE</option> 参数就可以了。 (输入
- <command>gs <option>-h</option></command> 来获得当前安装的
+ <command>gs -h</command> 来获得当前安装的
<application>Ghostscript</application> 所支持的设备列表。)</para>
<programlisting>#!/bin/sh
@@ -1846,16 +1810,15 @@ exit 2</programlisting>
<programlisting>:if=<filename>/usr/local/libexec/ifhp</filename>:</programlisting>
- <para>您可以输入 <command>lpr <filename><replaceable>plain.text</replaceable></filename></command>
- 和 <command>lpr <filename><replaceable>whatever.ps</replaceable></filename></command>,
+ <para>您可以输入 <command>lpr plain.text</command>
+ 和 <command>lpr whatever.ps</command>,
它们都应该可以成功打印。</para>
</sect3>
- <sect3 id="printing-advanced-convfilters">
+ <sect3 xml:id="printing-advanced-convfilters">
<title>转换过滤器 </title>
- <para>在完成了 <link
- linkend="printing-simple"> 打印机简单设置 </link> 这节中所描述的内容之后, 头一件事
+ <para>在完成了 <link linkend="printing-simple"> 打印机简单设置 </link> 这节中所描述的内容之后, 头一件事
恐怕就是为你喜爱的格式的文件安装转换过滤器了 (除了纯 ASCII 文本)。</para>
<sect4>
@@ -1872,18 +1835,17 @@ exit 2</programlisting>
我们都不能直接打印它直到我们将 DVI 文件转换成 &postscript;。
转换的命令应该是下面的样子:</para>
- <screen>&prompt.user; <userinput><command>dvips <filename><replaceable>seaweed-analysis.dvi</replaceable></filename></command></userinput>
-&prompt.user; <userinput><command>lpr <filename><replaceable>seaweed-analysis.ps</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>dvips seaweed-analysis.dvi</userinput>
+&prompt.user; <userinput>lpr seaweed-analysis.ps</userinput></screen>
<para>通过安装 DVI 文件的转换过滤器, 我们可以跳过每次手动转换这一步, 而让
<application>LPD</application> 来完成这个步骤。
现在, 每次要打印 DVI 文件, 我们只需要一步就可以打印它:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-d</option> <filename><replaceable>seaweed-analysis.dvi</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr -d seaweed-analysis.dvi</userinput></screen>
<para>我们要 <application>LPD</application> 转换 DVI 文件是通过指定
- <option>-d</option> 选项完成的。 <link
- linkend="printing-lpr-options-format">格式和转换
+ <option>-d</option> 选项完成的。 <link linkend="printing-lpr-options-format">格式和转换
选项</link> 这一节列出了所有的转换选项。</para>
<para>对于每种想要打印机支持的转换,
@@ -1972,7 +1934,7 @@ exit 2</programlisting>
</tgroup>
</informaltable>
- <para>在例子中, <command>lpr <option>-d</option></command>就是指
+ <para>在例子中, <command>lpr -d</command>就是指
打印机需要在<filename>/etc/printcap</filename>文件中
<literal>df</literal>变量所指的过滤器。</para>
@@ -1985,7 +1947,7 @@ exit 2</programlisting>
publishing 程序生成), 而且不打算打印 plot 文件,
就可以安装一个 Printerleaf 转换过滤器并且用
<literal>gf</literal> 变量指定它。 然后就可以告诉您的用户使用
- <command>lpr <option>-g</option></command> 就可以 <quote>打印 Printerleaf
+ <command>lpr -g</command> 就可以 <quote>打印 Printerleaf
文件。</quote></para>
</sect4>
@@ -1994,8 +1956,8 @@ exit 2</programlisting>
<para>以为安装的转换过滤器不是 &os; 基本系统的一部分,
所以它们可能是在
- <filename class="directory">/usr/local</filename> 目录下。 通常目录
- <filename class="directory">/usr/local/libexec</filename> 是保存它们的地方,
+ <filename>/usr/local</filename> 目录下。 通常目录
+ <filename>/usr/local/libexec</filename> 是保存它们的地方,
因为它们通常是通过
<application>LPD</application> 运行的;
普通用户应该并不需要直接运行它们。</para>
@@ -2014,13 +1976,13 @@ exit 2</programlisting>
# /etc/printcap for host rose - added df filter for bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
:if=<filename>/usr/local/libexec/psif</filename>:\
:df=<filename>/usr/local/libexec/psdf</filename>:</programlisting>
@@ -2040,8 +2002,7 @@ exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@"</programlisting>
<para>这段脚本以过滤器模式运行 <command>dvips</command> (参数
<option>-f</option> ) 并从标准输入读取要打印的任务。
然后运行 &postscript; 文本过滤器
- <command>lprps</command> (详见 <link
- linkend="printing-advanced-if-conversion">在
+ <command>lprps</command> (详见 <link linkend="printing-advanced-if-conversion">在
&postscript; 打印机上打印纯文本任务</link> 这一节), 并且带着
<application>LPD</application>
传给脚本的全部参数。 <command>lprps</command>
@@ -2081,7 +2042,7 @@ giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \
# /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:sh:sd=<filename class="directory">/var/spool/lpd/teak</filename>:mx#0:\
+ :lp=<filename>/dev/lpt0</filename>:sh:sd=<filename>/var/spool/lpd/teak</filename>:mx#0:\
:if=<filename>/usr/local/libexec/hpif</filename>:\
:vf=<filename>/usr/local/libexec/hpvf</filename>:</programlisting>
@@ -2144,7 +2105,7 @@ exit 2</programlisting>
<para>现在, 该困难的部分了: 编写过滤器。 为了实现过滤器, 我们需要一个
DVI-到-LaserJet/PCL 转换程序。 &os; Ports
Collection (详见 <link linkend="ports">Ports Collection</link> 这一节)
- 中有一个: <filename role="package">print/dvi2xx</filename>。
+ 中有一个: <package>print/dvi2xx</package>。
安装这个 port 就会得到我们需要的程序,
<command>dvilj2p</command> , 它可以将 DVI 数据转换成 LaserJet IIp,
LaserJet III, 和 LaserJet 2000 兼容的数据。</para>
@@ -2154,17 +2115,17 @@ exit 2</programlisting>
<command>dvilj2p</command> 不能读取标准输入。
它需要从文件中读取数据。 更糟糕的是, 这个文件的名字必须以
<filename>.dvi</filename> 结尾。 所以使用
- <filename class="devicefile">/dev/fd/0</filename> 作为标准输入是有问题的。
+ <filename>/dev/fd/0</filename> 作为标准输入是有问题的。
我们可以通过连接 (符号连接) 来解决这个问题。 连接一个临时的文件名
(一个以 <filename>.dvi</filename> 结尾的文件名)
- 到 <filename class="devicefile">/dev/fd/0</filename>, 从而强制
+ 到 <filename>/dev/fd/0</filename>, 从而强制
<command>dvilj2p</command> 从标准输入读取。</para>
<para>现在迎面而来的是另外一个问题, 我们不能使用
- <filename class="directory">/tmp</filename> 存放临时连接。 符号连接是被用户和组
- <username>bin</username> 拥有的。 而过滤器则是以
- <username>daemon</username> 用户运行的。
- 并且 <filename class="directory">/tmp</filename> 目录设置了 sticky 位。
+ <filename>/tmp</filename> 存放临时连接。 符号连接是被用户和组
+ <systemitem class="username">bin</systemitem> 拥有的。 而过滤器则是以
+ <systemitem class="username">daemon</systemitem> 用户运行的。
+ 并且 <filename>/tmp</filename> 目录设置了 sticky 位。
所以过滤器只能建立符号连接,
但它不能在用完之后清除掉这些连接。
因为它们属于不同的用户。</para>
@@ -2175,7 +2136,7 @@ exit 2</programlisting>
<filename>/etc/printcap</filename> 中指定)。
这是一个非常好的让过滤器完成它工作的地方,
特别还是因为 (有时) 这个目录比起
- <filename class="directory">/tmp</filename> 来有更多的可用磁盘空间。</para>
+ <filename>/tmp</filename> 来有更多的可用磁盘空间。</para>
<para>最后, 给出过滤器的代码:</para>
@@ -2240,7 +2201,7 @@ cleanup
exit 0</programlisting>
</sect4>
- <sect4 id="printing-advanced-autoconv">
+ <sect4 xml:id="printing-advanced-autoconv">
<title>自动转换: 一种替代转换过滤器的方法</title>
<para>以上这些转换过滤器基本上建成了您的打印环境,
@@ -2268,13 +2229,13 @@ exit 0</programlisting>
<tertiary>apsfilter</tertiary>
</indexterm>
<para>&os; 的 Ports 套件提供了一个可以自动进行转换的文本过滤器,
- 名字叫做 <command>apsfilter</command> (<filename role="package">print/apsfilter</filename>)。
+ 名字叫做 <command>apsfilter</command> (<package>print/apsfilter</package>)。
它可以检测纯文本、 &postscript;、 DVI 以及几乎任何格式的文件,
并在执行相应的转换之后完成打印工作。</para>
</sect4>
</sect3>
- <sect3 id="printing-advanced-of">
+ <sect3 xml:id="printing-advanced-of">
<title>输出过滤器</title>
<para><application>LPD</application> 后台打印系统还支持一种我们还没有讨论过的过滤器:
@@ -2315,8 +2276,7 @@ exit 0</programlisting>
<para>不要让输出过滤器的简化所耽误。
如果想要输出过滤器完成让任务中的每个文件都重新开始一页打印是
<emphasis>不可能</emphasis> 的。 请使用文本过滤器
- (也叫输入过滤器); 详见 <link
- linkend="printing-textfilter">安装文本过滤器</link>。
+ (也叫输入过滤器); 详见 <link linkend="printing-textfilter">安装文本过滤器</link>。
此外, 实际上, 输出过滤器 <emphasis>更复杂</emphasis> ,
它要检查发给它的字节流中是否有特殊的标志字符,
并且给自己发送信号来代替
@@ -2330,8 +2290,7 @@ exit 0</programlisting>
<para>在一台单个的打印机上, <application>LPD</application>
同时允许输出过滤器、 文本过滤器和其他的过滤器。
- 在某些情况下, <application>LPD</application> 将仅会启动输出过滤器来打印报头页 (详见 <link
- linkend="printing-advanced-header-pages">报头页</link>)。
+ 在某些情况下, <application>LPD</application> 将仅会启动输出过滤器来打印报头页 (详见 <link linkend="printing-advanced-header-pages">报头页</link>)。
然后 <application>LPD</application> 会要求输出过滤器 <emphasis>自己停止运行</emphasis> ,
它发送给过滤器两个字节: ASCII 031跟着一个
ASCII 001。 当输出过滤器看见这两个字节
@@ -2356,15 +2315,15 @@ exit 0</programlisting>
<command>lpf</command> 也可以包含在一个 shell 脚本中来处理任何打印机可能需要的初始化代码。</para>
</sect3>
- <sect3 id="printing-advanced-lpf">
+ <sect3 xml:id="printing-advanced-lpf">
<title><command>lpf</command>: 一个文本过滤器</title>
<para><filename>/usr/libexec/lpr/lpf</filename> 这个程序包含在
&os; 的二进制程序中, 它是一个文本过滤器 (输入过滤器)。
它可以缩排输出 (用
- <command>lpr <option>-i</option></command> 命令提交的任务),
+ <command>lpr -i</command> 命令提交的任务),
可以打印控制字符禁止断页用
- <command>lpr <option>-l</option></command> 提交的任务),
+ <command>lpr -l</command> 提交的任务),
可以调整任务中退格和制表符打印的位置, 还可以对打印进行记帐。
它同样可以像输出过滤器一样工作。</para>
@@ -2383,12 +2342,11 @@ exit 0</programlisting>
那么需要 <filename>/etc/printcap</filename> 中的 <literal>pw</literal> 和 <literal>pl</literal> 变量都填入正确的值。
它用这些值来测定一页能打印多少文本,
并计算出任务有多少页。
- 想得到更多关于打印记帐的信息, 请参见 <link
- linkend="printing-advanced-acct">对打印机使用进行记帐</link>。</para>
+ 想得到更多关于打印记帐的信息, 请参见 <link linkend="printing-advanced-acct">对打印机使用进行记帐</link>。</para>
</sect3>
</sect2>
- <sect2 id="printing-advanced-header-pages">
+ <sect2 xml:id="printing-advanced-header-pages">
<title>报头页</title>
<para>如果您有 <emphasis>很多</emphasis> 用户, 他们正在使用各式各样的打印机,
@@ -2414,10 +2372,9 @@ exit 0</programlisting>
<para><application>LPD</application> 系统可以自动为您的打印提供报头页,
<emphasis>如果</emphasis> 您的打印机可以直接打印纯文本。
如果您的打印机是一台 &postscript; 打印机,
- 您将需要一个外部的程序来生成报头页; 详见 <link
- linkend="printing-advanced-header-pages-ps">在 &postscript; 打印机上打印报头页</link>。</para>
+ 您将需要一个外部的程序来生成报头页; 详见 <link linkend="printing-advanced-header-pages-ps">在 &postscript; 打印机上打印报头页</link>。</para>
- <sect3 id="printing-advanced-header-pages-enabling">
+ <sect3 xml:id="printing-advanced-header-pages-enabling">
<title>打开报头页</title>
<para>在 <link linkend="printing-simple">简单打印设置</link>
@@ -2440,8 +2397,7 @@ printf "\033&amp;k2G" || exit 2
exec /usr/libexec/lpr/lpf</programlisting>
<para>用
- <literal>of</literal> 变量指定输出过滤器的路径。 参见 <link
- linkend="printing-advanced-of">输出过滤器</link> 这一节来得到更多信息。</para>
+ <literal>of</literal> 变量指定输出过滤器的路径。 参见 <link linkend="printing-advanced-of">输出过滤器</link> 这一节来得到更多信息。</para>
<para>下面是一个为我们以前介绍的叫做 <literal>teak</literal>
的打印机配置的 <filename>/etc/printcap</filename> 文件;
@@ -2451,7 +2407,7 @@ exec /usr/libexec/lpr/lpf</programlisting>
# /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:sd=<filename class="directory">/var/spool/lpd/teak</filename>:mx#0:\
+ :lp=<filename>/dev/lpt0</filename>:sd=<filename>/var/spool/lpd/teak</filename>:mx#0:\
:if=<filename>/usr/local/libexec/hpif</filename>:\
:vf=<filename>/usr/local/libexec/hpvf</filename>:\
:of=<filename>/usr/local/libexec/hpof</filename>:</programlisting>
@@ -2459,8 +2415,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
<para>现在, 当用户再发任务给打印机 <literal>teak</literal> 的时候,
每个任务都会有一个报头页。 如果用户想要花时间来寻找他们自己打印的文件,
那么他们可以通过
- <command>lpr <option>-h</option></command> 命令来提交任务; 参考 <link
- linkend="printing-lpr-options-misc">报头页选项</link>
+ <command>lpr -h</command> 命令来提交任务; 参考 <link linkend="printing-lpr-options-misc">报头页选项</link>
这一节来得到更多关于 &man.lpr.1; 的选项。</para>
<note>
@@ -2471,14 +2426,14 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
</note>
</sect3>
- <sect3 id="printing-advanced-header-pages-controlling">
+ <sect3 xml:id="printing-advanced-header-pages-controlling">
<title>控制报头页</title>
<para>通过启用报头页, <application>LPD</application>
将生成出一个 <emphasis>长报头</emphasis>,
一整页的大字母, 标着用户, 主机和任务名。
- 下面是一个例子 (<username>kelly</username> 从主机
- <hostid>rose</hostid> 打印了一个叫做 <quote>outline</quote> 的任务):</para>
+ 下面是一个例子 (<systemitem class="username">kelly</systemitem> 从主机
+ <systemitem>rose</systemitem> 打印了一个叫做 <quote>outline</quote> 的任务):</para>
<screen> k ll ll
k l l
@@ -2548,7 +2503,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
中指定 <literal>hl</literal> (最后报头)。</para>
</sect3>
- <sect3 id="printing-advanced-header-pages-accounting">
+ <sect3 xml:id="printing-advanced-header-pages-accounting">
<title>为带报头页的任务记帐</title>
<para>使用 <application>LPD</application>
@@ -2564,14 +2519,14 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
如果仅仅是
<quote>增加一页计数</quote> 给文本过滤器或者其他过滤器
(它们有用户和主机的信息) 是不够的, 因为用户可以用
- <command>lpr <option>-h</option></command> 命令跳过报头页。
+ <command>lpr -h</command> 命令跳过报头页。
他还是需要为自己并没有打印的报头页付钱。
- 基本上, <command>lpr <option>-h</option></command> 是明知用户的首选,
+ 基本上, <command>lpr -h</command> 是明知用户的首选,
但也不能强制让别人使用它。</para>
<para>让每个过滤器生成自己的报头页
(因此可以为它们计费) 是 <emphasis>仍然不够的</emphasis>。
- 如果用户想要用 <command>lpr <option>-h</option></command>
+ 如果用户想要用 <command>lpr -h</command>
命令禁止报头页, 它们将仍然印出报头页并且为它们付费。
因为 <application>LPD</application>
不会把
@@ -2619,7 +2574,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
</itemizedlist>
</sect3>
- <sect3 id="printing-advanced-header-pages-ps">
+ <sect3 xml:id="printing-advanced-header-pages-ps">
<title>在 &postscript; 打印机上打印报头页</title>
<para>像上面描述的那样,<application>LPD</application>
@@ -2631,7 +2586,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
这些过滤器应该用用户名和主机的参数来生成一个相对应的报头页。
这种方法的缺点就是用户总是打印出报头页,
无论他们是否用
- <command>lpr <option>-h</option></command>
+ <command>lpr -h</command>
命令来提交的任务。</para>
<para>让我们来深入深入的研究一下这个方法。
@@ -2759,8 +2714,7 @@ done
<para>过滤器是怎样解释参数列表来决定用户名和主机名的。
解释的方法对于其他转换过滤器来说也是一样的。
尽管文本过滤器需要输入的参数有些小的不同,
- (参见 <link
- linkend="printing-advanced-filters">过滤器是怎样工作的</link>)。</para>
+ (参见 <link linkend="printing-advanced-filters">过滤器是怎样工作的</link>)。</para>
<para>像我们以前提到的那样, 上面的配置, 尽管相当简单,
关掉了 <quote>禁止报头页</quote> 的选项
@@ -2769,12 +2723,11 @@ done
它还不能完成这件事情, 因为每个过滤器都要为每个任务打印一个报头页。</para>
<para>要允许用户对于每个任务都可以关闭报头页,
- 您需要使用在 <link
- linkend="printing-advanced-header-pages-accounting">为报头页记帐</link>
+ 您需要使用在 <link linkend="printing-advanced-header-pages-accounting">为报头页记帐</link>
这节中介绍的那种技巧:
写一个输出过滤器来解释 LPD- 生成的报头页并且生成一个 &postscript; 的版本。
如果用户用
- <command>lpr <option>-h</option></command> 命令提交任务, 那么
+ <command>lpr -h</command> 命令提交任务, 那么
<application>LPD</application> 将不会生成报头页,
并且输出过滤器也不会生成报头页。
否则, 输出过滤器将从
@@ -2788,7 +2741,7 @@ done
</sect3>
</sect2>
- <sect2 id="printing-advanced-network-printers">
+ <sect2 xml:id="printing-advanced-network-printers">
<title>网络打印</title>
<indexterm>
@@ -2805,8 +2758,7 @@ done
在一台主机上安装一台常规的串口或并口打印机。
然后, 设置 <application>LPD</application>
来通过网络访问其他主机上的打印机。
- 具体见 <link
- linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>
+ 具体见 <link linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>
这节。</para>
</listitem>
@@ -2829,15 +2781,14 @@ done
<para>它或许支持网络数据流。
这样, 把打印机 <quote>接</quote> 在一台网络上的主机上,
由这台主机负责安排任务并发送任务到打印机。
- 参见 <link
- linkend="printing-advanced-network-net-if">带网络数据流接口的打印机</link>
+ 参见 <link linkend="printing-advanced-network-net-if">带网络数据流接口的打印机</link>
这节来得到更多安装这类打印机的建议。</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
- <sect3 id="printing-advanced-network-rm">
+ <sect3 xml:id="printing-advanced-network-rm">
<title>安装在远程主机上的打印机</title>
<para><application>LPD</application> 后台打印系统内建了对给其他也运行着
@@ -2850,14 +2801,12 @@ done
<para>要开启这种远程打印的功能, 首先在一台主机上安装打印机, 就是
<emphasis>打印服务器</emphasis>, 可以使用在
<link linkend="printing-simple">简单打印机设置</link>
- 这节中简单设置的方法。 高级的设置可以参考 <link
- linkend="printing-advanced">高级打印机设置</link> 这节中你需要的部分。
+ 这节中简单设置的方法。 高级的设置可以参考 <link linkend="printing-advanced">高级打印机设置</link> 这节中你需要的部分。
一定要测试一下打印机, 看看它是不是所有您开启的
<application>LPD</application> 的功能都正常工作。 此外还需要确认
<emphasis>本地主机</emphasis> 允许使用 <emphasis>远程主机</emphasis> 上的
<application>LPD</application>
- 服务 (参见 <link
- linkend="printing-advanced-restricting-remote">限制远程主打印任务</link>)。</para>
+ 服务 (参见 <link linkend="printing-advanced-restricting-remote">限制远程主打印任务</link>)。</para>
<indexterm>
<primary>printers</primary>
@@ -2915,15 +2864,14 @@ done
页面大小, 或者其他的一些东西在
<filename>/etc/printcap</filename> 文件中。</para>
- <para>这有一个例子。 主机 <hostid>rose</hostid> 有两台打印机,
+ <para>这有一个例子。 主机 <systemitem>rose</systemitem> 有两台打印机,
<literal>bamboo</literal> 和 <literal>rattan</literal>。
- 我们要让主机 <hostid>orchid</hostid> 的用户可以使用这两台打印机。
+ 我们要让主机 <systemitem>orchid</systemitem> 的用户可以使用这两台打印机。
下面是 <filename>/etc/printcap</filename> 文件, 用在主机
- <hostid>orchid</hostid> (详见 <link
- linkend="printing-advanced-header-pages-enabling">开启报头页</link>)
+ <systemitem>orchid</systemitem> (详见 <link linkend="printing-advanced-header-pages-enabling">开启报头页</link>)
上的。 文件中已经有了打印机
<literal>teak</literal> 的记录; 我们在主机
- <hostid>rose</hostid> 上增加了两台打印机:</para>
+ <systemitem>rose</systemitem> 上增加了两台打印机:</para>
<programlisting>#
# /etc/printcap for host orchid - added (remote) printers on rose
@@ -2933,7 +2881,7 @@ done
# teak is local; it is connected directly to orchid:
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:sd=<filename class="directory">/var/spool/lpd/teak</filename>:mx#0:\
+ :lp=<filename>/dev/lpt0</filename>:sd=<filename>/var/spool/lpd/teak</filename>:mx#0:\
:if=<filename>/usr/local/libexec/ifhp</filename>:\
:vf=<filename>/usr/local/libexec/vfhp</filename>:\
:of=<filename>/usr/local/libexec/ofhp</filename>:
@@ -2942,40 +2890,40 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
# rattan is connected to rose; send jobs for rattan to rose:
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :lp=:rm=rose:rp=rattan:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:
+ :lp=:rm=rose:rp=rattan:sd=<filename>/var/spool/lpd/rattan</filename>:
#
# bamboo is connected to rose as well:
#
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :lp=:rm=rose:rp=bamboo:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:</programlisting>
+ :lp=:rm=rose:rp=bamboo:sd=<filename>/var/spool/lpd/bamboo</filename>:</programlisting>
<para>然后, 我们只需要在主机
- <hostid>orchid</hostid> 上建立一个后台打印队列目录:</para>
+ <systemitem>orchid</systemitem> 上建立一个后台打印队列目录:</para>
- <screen>&prompt.root; <userinput><command>mkdir <option>-p</option> <filename class="directory">/var/spool/lpd/rattan</filename> <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput>
-&prompt.root; <userinput><command>chmod 770 <filename class="directory">/var/spool/lpd/rattan</filename> <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput>
-&prompt.root; <userinput><command>chown daemon:daemon <filename class="directory">/var/spool/lpd/rattan</filename> <filename class="directory">/var/spool/lpd/bamboo</filename></command></userinput></screen>
+ <screen>&prompt.root; <userinput>mkdir -p /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput>
+&prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput>
+&prompt.root; <userinput>chown daemon:daemon /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput></screen>
- <para>现在, 主机 <hostid>orchid</hostid> 上的用户可以打印到
+ <para>现在, 主机 <systemitem>orchid</systemitem> 上的用户可以打印到
<literal>rattan</literal> 和 <literal>bamboo</literal> 了。 如果,
- 比如, 一个用户在主机 <hostid>orchid</hostid> 上输入了:</para>
+ 比如, 一个用户在主机 <systemitem>orchid</systemitem> 上输入了:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-P</option> bamboo <option>-d</option> <filename><replaceable>sushi-review.dvi</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr -P bamboo -d sushi-review.dvi</userinput></screen>
- <para><application>LPD</application> 系统在主机 <hostid>orchid</hostid>
+ <para><application>LPD</application> 系统在主机 <systemitem>orchid</systemitem>
上会复制这个任务到后台打印队列目录
<filename>/var/spool/lpd/bamboo</filename> 并且记下这是一个
- DVI 任务。 当主机 <hostid>rose</hostid> 上的打印机
+ DVI 任务。 当主机 <systemitem>rose</systemitem> 上的打印机
<literal>bamboo</literal> 的后台打印队列目录有空间的时, 这两个
<application>LPD</application> 系统将会传输这个文件到主机
- <hostid>rose</hostid> 上。 文件将排在主机 <hostid>rose</hostid>
+ <systemitem>rose</systemitem> 上。 文件将排在主机 <systemitem>rose</systemitem>
的队列中直到最终被打印出来。 它将被从 DVI 转换成
&postscript; (因为 <literal>bamboo</literal> 是一台 &postscript; 打印机) 在主机
- <hostid>rose</hostid>。</para>
+ <systemitem>rose</systemitem>。</para>
</sect3>
- <sect3 id="printing-advanced-network-net-if">
+ <sect3 xml:id="printing-advanced-network-net-if">
<title>带有网络数据流接口的打印机</title>
<para>通常, 当您为打印机购买了一块网卡,
@@ -2983,8 +2931,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
或者一个只发送数据给打印机就像在使用串口或者并口一样
(便宜一些的版本)。
这节讲述如何使用这个便宜一些的版本。 要得到贵一些版本的更多信息,
- 参见前面章节 <link
- linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>。</para>
+ 参见前面章节 <link linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>。</para>
<para><filename>/etc/printcap</filename> 文件的格式让您指定使用哪个串口或并口,
并且还要指定 (如果您正在使用串口),
@@ -3028,7 +2975,7 @@ exit 0;</programlisting>
<para>然后我们就可以在多种过滤器里使用这个脚本了。 加入我们有一台
Diablo 750-N 行式打印机联在网络上。 打印机在 5100 端口上接收要打印的数据。
- 打印机的主机名是 <hostid>scrivener</hostid>。
+ 打印机的主机名是 <systemitem>scrivener</systemitem>。
这里是为这个打印机写的文本过滤器:</para>
<programlisting>#!/bin/sh
@@ -3040,7 +2987,7 @@ exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100</pro
</sect3>
</sect2>
- <sect2 id="printing-advanced-restricting">
+ <sect2 xml:id="printing-advanced-restricting">
<title>限制打印机的使用</title>
<indexterm>
@@ -3053,11 +3000,11 @@ exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100</pro
是否他们可以打印机多份副本, 任务可以有多大,
以及打印队列的尺寸等。</para>
- <sect3 id="printing-advanced-restricting-copies">
+ <sect3 xml:id="printing-advanced-restricting-copies">
<title>限制多份副本</title>
<para><application>LPD</application> 系统能够简化用户在打印多份副本时的工作。
- 用户可以用 <command>lpr <option>-#5</option></command>
+ 用户可以用 <command>lpr -#5</command>
(举例) 来提交打印任务, 则会将任务中每个文件都打印五份副本。
这是不是一件很棒的事情呢。</para>
@@ -3077,7 +3024,7 @@ exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100</pro
<para>下面是一个例子。 这个是
<filename>/etc/printcap</filename> 文件在主机
- <hostid>rose</hostid> 上。 打印机 <literal>rattan</literal>
+ <systemitem>rose</systemitem> 上。 打印机 <literal>rattan</literal>
非常轻闲, 所以我们将允许多份副本, 但是激光打印机
<literal>bamboo</literal> 则有些忙, 所以我们禁止多份副本,
通过增加 <literal>sc</literal>
@@ -3087,18 +3034,18 @@ exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100</pro
# /etc/printcap for host rose - restrict multiple copies on bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:sc:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:sc:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
:if=<filename>/usr/local/libexec/psif</filename>:\
:df=<filename>/usr/local/libexec/psdf</filename>:</programlisting>
<para>现在, 我们还需要增机 <literal>sc</literal> 变量在主机
- <hostid>orchid</hostid> 的
+ <systemitem>orchid</systemitem> 的
<filename>/etc/printcap</filename> 文件中 (顺便我们也禁止打印机
<literal>teak</literal> 多份打印) :</para>
@@ -3106,30 +3053,30 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
# /etc/printcap for host orchid - no multiple copies for local
# printer teak or remote printer bamboo
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:sd=<filename class="directory">/var/spool/lpd/teak</filename>:mx#0:sc:\
+ :lp=<filename>/dev/lpt0</filename>:sd=<filename>/var/spool/lpd/teak</filename>:mx#0:sc:\
:if=<filename>/usr/local/libexec/ifhp</filename>:\
:vf=<filename>/usr/local/libexec/vfhp</filename>:\
:of=<filename>/usr/local/libexec/ofhp</filename>:
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :lp=:rm=rose:rp=rattan:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:
+ :lp=:rm=rose:rp=rattan:sd=<filename>/var/spool/lpd/rattan</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :lp=:rm=rose:rp=bamboo:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:sc:</programlisting>
+ :lp=:rm=rose:rp=bamboo:sd=<filename>/var/spool/lpd/bamboo</filename>:sc:</programlisting>
<para>通过使用 <literal>sc</literal> 变量, 我们阻止了
- <command>lpr <option>-#</option></command> 命令的使用, 但仍然没有禁止用户多次运行
+ <command>lpr -#</command> 命令的使用, 但仍然没有禁止用户多次运行
&man.lpr.1; ,
或者多次提交任务中同样的文件,
像下面这样:</para>
- <screen>&prompt.user; <userinput>lpr <filename><replaceable>forsale.sign forsale.sign forsale.sign forsale.sign forsale.sign</replaceable></filename></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr forsale.sign forsale.sign forsale.sign forsale.sign forsale.sign</userinput></screen>
<para>这里有很多种方法可以阻止这种行为 (包括忽略它),
并且是免费的。</para>
</sect3>
- <sect3 id="printing-advanced-restricting-access">
+ <sect3 xml:id="printing-advanced-restricting-access">
<title>限制对打印机的访问</title>
<para>您可以控制谁可以打印到哪台打印机通过 &unix;
@@ -3138,7 +3085,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
只要把可以访问打印机的用户放进适当的组中, 然后在
<literal>rg</literal> 变量中写上组的名字。</para>
- <para>如果这组以外的用户 (包括 <username>root</username>)
+ <para>如果这组以外的用户 (包括 <systemitem class="username">root</systemitem>)
试图打印到被限制的打印机,将会得到这样的提示:</para>
<screen>lpr: Not a member of the restricted group</screen>
@@ -3146,35 +3093,34 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>像使用 <literal>sc</literal> (禁止多份副本)
变量一样, 您需要指定 <literal>rg</literal>
在远程同样对打印机有访问限制的主机上,
- 如果您感觉合适的话 (参考 <link
- linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link> 这一节)。</para>
+ 如果您感觉合适的话 (参考 <link linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link> 这一节)。</para>
<para>比如, 我们将让任何人都可以访问打印机
<literal>rattan</literal>, 但只有在
- <groupname>artists</groupname> 组中的人可以使用打印机 <literal>bamboo</literal>。
- 这里是类似的主机 <hostid>rose</hostid> 上的
+ <systemitem class="groupname">artists</systemitem> 组中的人可以使用打印机 <literal>bamboo</literal>。
+ 这里是类似的主机 <systemitem>rose</systemitem> 上的
<filename>/etc/printcap</filename> 文件:</para>
<programlisting>#
# /etc/printcap for host rose - restricted group for bamboo
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:sc:rg=artists:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:sc:rg=artists:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
:if=<filename>/usr/local/libexec/psif</filename>:\
:df=<filename>/usr/local/libexec/psdf</filename>:</programlisting>
<para>Let us leave the other example
<filename>/etc/printcap</filename> file (for the host
- <hostid>orchid</hostid>) alone. Of course, anyone on
- <hostid>orchid</hostid> can print to <literal>bamboo</literal>. It
+ <systemitem>orchid</systemitem>) alone. Of course, anyone on
+ <systemitem>orchid</systemitem> can print to <literal>bamboo</literal>. It
might be the case that we only allow certain logins on
- <hostid>orchid</hostid> anyway, and want them to have access to the
+ <systemitem>orchid</systemitem> anyway, and want them to have access to the
printer. Or not.</para>
<note>
@@ -3182,7 +3128,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
</note>
</sect3>
- <sect3 id="printing-advanced-restricting-sizes">
+ <sect3 xml:id="printing-advanced-restricting-sizes">
<title>控制提交的任务大小</title>
<indexterm><primary>print jobs</primary></indexterm>
@@ -3216,7 +3162,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>让我们来为例子打印机
<literal>rattan</literal> 和 <literal>bamboo</literal> 增加限制。
- 由于那些 <groupname>artists</groupname> 的 &postscript; 文件可能会很大,
+ 由于那些 <systemitem class="groupname">artists</systemitem> 的 &postscript; 文件可能会很大,
我们将限制大小为 5 兆字节。 我们将不对纯文本行式打印机做限制:</para>
<programlisting>#
@@ -3227,16 +3173,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
# No limit on job size:
#
rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:mx#0:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:mx#0:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:
#
# Limit of five megabytes:
#
bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:sc:rg=artists:mx#5000:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:sc:rg=artists:mx#5000:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:\
:if=<filename>/usr/local/libexec/psif</filename>:\
:df=<filename>/usr/local/libexec/psdf</filename>:</programlisting>
@@ -3244,16 +3190,14 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
如果设置了允许远程用户使用您的打印机, 远程用户将不会受到这些限制。
您也需要指定 <literal>mx</literal>
变量在远程主机的 <filename>/etc/printcap</filename> 文件中。
- 参见 <link
- linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>
+ 参见 <link linkend="printing-advanced-network-rm">安装在远程主机上的打印机</link>
这一节来得到更多有关远程打印的信息。</para>
<para>除此之外, 还有另一种限制远程任务大小的方法;
- 参见 <link
- linkend="printing-advanced-restricting-remote">限制远程主机打印任务</link>。</para>
+ 参见 <link linkend="printing-advanced-restricting-remote">限制远程主机打印任务</link>。</para>
</sect3>
- <sect3 id="printing-advanced-restricting-remote">
+ <sect3 xml:id="printing-advanced-restricting-remote">
<title>限制远程主机打印任务</title>
<para><application>LPD</application> 后台打印系统提供了多种方法来限制从远程主机提交的任务:</para>
@@ -3279,16 +3223,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<para>举个例子, 下面是
<filename>/etc/hosts.lpd</filename> 文件在主机
- <hostid>rose</hostid> 上:</para>
+ <systemitem>rose</systemitem> 上:</para>
<programlisting>orchid
violet
madrigal.fishbaum.de</programlisting>
- <para>意思是主机 <hostid>rose</hostid> 将接收来自
- <hostid>orchid</hostid>, <hostid>violet</hostid>,
- 和 <hostid role="fqdn">madrigal.fishbaum.de</hostid> 的请求。
- 如果任何其他的主机试图访问主机 <hostid>rose</hostid> 的
+ <para>意思是主机 <systemitem>rose</systemitem> 将接收来自
+ <systemitem>orchid</systemitem>, <systemitem>violet</systemitem>,
+ 和 <systemitem class="fqdomainname">madrigal.fishbaum.de</systemitem> 的请求。
+ 如果任何其他的主机试图访问主机 <systemitem>rose</systemitem> 的
<application>LPD</application>, 任务将被拒绝。</para>
</listitem>
</varlistentry>
@@ -3316,8 +3260,8 @@ madrigal.fishbaum.de</programlisting>
的记录:</para>
<programlisting>bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
- :sh:sd=<filename class="directory">/var/spool/lpd/bamboo</filename>:sc:rg=artists:mx#5000:\
- :lp=<filename class="devicefile">/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:mx#5000:\
+ :sh:sd=<filename>/var/spool/lpd/bamboo</filename>:sc:rg=artists:mx#5000:\
+ :lp=<filename>/dev/ttyu5</filename>:ms#-parenb cs8 clocal crtscts:rw:mx#5000:\
:if=<filename>/usr/local/libexec/psif</filename>:\
:df=<filename>/usr/local/libexec/psdf</filename>:</programlisting>
@@ -3326,7 +3270,7 @@ madrigal.fishbaum.de</programlisting>
为文件系统上必须存在的总共剩余空间, 让
<application>LPD</application> 可以接受远程任务:</para>
- <screen>&prompt.root; <userinput><command>echo 6144 &gt; <filename>/var/spool/lpd/bamboo/minfree</filename></command>
+ <screen>&prompt.root; <userinput>echo 6144 &gt; /var/spool/lpd/bamboo/minfree
</userinput></screen>
</listitem>
</varlistentry>
@@ -3357,7 +3301,7 @@ madrigal.fishbaum.de</programlisting>
</sect3>
</sect2>
- <sect2 id="printing-advanced-acct">
+ <sect2 xml:id="printing-advanced-acct">
<title>对打印机使用记帐</title>
<indexterm>
@@ -3381,8 +3325,7 @@ madrigal.fishbaum.de</programlisting>
(对纯文本任务记费) 和转换过滤器
(对其他格式的文件计费), 要统计页数或者查询打印了多少页的话。
您不可以通过使用简单的输出过滤器来逃脱计费,
- 因为它不能进行记帐。 参见 <link
- linkend="printing-advanced-filter-intro">过滤器</link> 这节。</para>
+ 因为它不能进行记帐。 参见 <link linkend="printing-advanced-filter-intro">过滤器</link> 这节。</para>
<para>通常, 有两种方法来进行记帐:</para>
@@ -3423,8 +3366,7 @@ madrigal.fishbaum.de</programlisting>
<para>&os; 包含两个可以让您立刻可以建立起简单的阶段记帐的程序。
它们是文本过滤器
- <command>lpf</command>, 在 <link
- linkend="printing-advanced-lpf">lpf: 一个文本过滤器</link> 这节中描述, 和
+ <command>lpf</command>, 在 <link linkend="printing-advanced-lpf">lpf: 一个文本过滤器</link> 这节中描述, 和
&man.pac.8;, 一个收集并统计打印机记帐文件中记录的程序。</para>
<para>像在前面章节提到的过滤器一样
@@ -3503,9 +3445,9 @@ total 337.00 154 $ 6.74</screen>
<listitem>
<para>忽略记帐文件中的主机名。 带上这个选项,
- 用户 <username>smith</username> 在主机
- <hostid>alpha</hostid> 上与同样的用户
- <username>smith</username> 在主机 <hostid>gamma</hostid> 上一样。
+ 用户 <systemitem class="username">smith</systemitem> 在主机
+ <systemitem>alpha</systemitem> 上与同样的用户
+ <systemitem class="username">smith</systemitem> 在主机 <systemitem>gamma</systemitem> 上一样。
不带这个选项的话, 他们则是不同的用户。</para>
</listitem>
</varlistentry>
@@ -3554,7 +3496,7 @@ total 337.00 154 $ 6.74</screen>
<para>在 &man.pac.8; 默认产生的摘要中,
可以看到在不同主机上的每个用户打印了多少页。
如果在您这里, 主机不考虑 (因为用户可以使用任何主机),
- 运行 <command>pac <option>-m</option></command>,
+ 运行 <command>pac -m</command>,
来得到下面的摘要:</para>
<screen> Login pages/feet runs price
@@ -3577,12 +3519,12 @@ total 337.00 154 $ 6.74</screen>
的单位是美元, 而不是百分之一分。
例如,</para>
- <screen>&prompt.root; <userinput><command>pac <option>-p1.50</option></command></userinput></screen>
+ <screen>&prompt.root; <userinput>pac -p1.50</userinput></screen>
<para>设定每页的价格是 1 美元 5 美分。
您可以通过这个选项来达到目标利润。</para>
- <para>最终, 运行 <command>pac <option>-s</option></command> 将存储这些信息在一个记帐文件里,
+ <para>最终, 运行 <command>pac -s</command> 将存储这些信息在一个记帐文件里,
文件名和打印机帐户的名字相同,
但是带着 <literal>_sum</literal>
的后缀。 然后截短记帐文件。
@@ -3601,8 +3543,7 @@ total 337.00 154 $ 6.74</screen>
对任务中的行数进行计数然后与打印机支持的每页行数进行比较。
别忘了也对添印的行, 或者很长的逻辑上的一行但在打印机上会折成两行的这类进行记帐。</para>
- <para>文本过滤器 <command>lpf</command> (在 <link
- linkend="printing-advanced-lpf">lpf:一个文本过滤器</link> 这节中介绍)
+ <para>文本过滤器 <command>lpf</command> (在 <link linkend="printing-advanced-lpf">lpf:一个文本过滤器</link> 这节中介绍)
会在记帐时考虑这些问题。
如果正在编写一个可以进行记帐的文本过滤器,
您可能需要查看 <command>lpf</command> 的源代码。</para>
@@ -3635,7 +3576,7 @@ total 337.00 154 $ 6.74</screen>
</sect2>
</sect1>
- <sect1 id="printing-using">
+ <sect1 xml:id="printing-using">
<title>使用打印机</title>
<indexterm>
@@ -3671,8 +3612,7 @@ total 337.00 154 $ 6.74</screen>
</varlistentry>
</variablelist>
- <para>还有一个管理命令, &man.lpc.8;, 在 <link
- linkend="printing-lpc">管理打印机</link> 一节中有所介绍,
+ <para>还有一个管理命令, &man.lpc.8;, 在 <link linkend="printing-lpc">管理打印机</link> 一节中有所介绍,
它可以用于控制打印机及其队列。</para>
<para> &man.lpr.1;, &man.lprm.1;, and &man.lpq.1;
@@ -3691,41 +3631,40 @@ total 337.00 154 $ 6.74</screen>
或者叫做 <literal>lp</literal> 的这一台当没有环境变量
<envar>PRINTER</envar> 的时候。</para>
- <sect2 id="printing-lpr">
+ <sect2 xml:id="printing-lpr">
<title>打印任务</title>
<para>要打印文件, 输入:</para>
- <screen>&prompt.user; <userinput><command>lpr <filename><replaceable>filename</replaceable></filename> <replaceable>...</replaceable></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr filename ...</userinput></screen>
<indexterm><primary>printing</primary></indexterm>
<para>这个命令会打印所有列出的文件到默认打印机。
如果没有列出文件, &man.lpr.1; 会从标准输入读取打印数据。
比如, 这个命令打印一些重要的系统文件:</para>
- <screen>&prompt.user; <userinput><command>lpr <filename>/etc/host.conf</filename> <filename>/etc/hosts.equiv</filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr /etc/host.conf /etc/hosts.equiv</userinput></screen>
<para>要选择一个指定的打印机, 输入:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-P</option> <replaceable>printer-name</replaceable> <filename><replaceable>filename</replaceable></filename> <replaceable>...</replaceable></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr -P printer-name filename ...</userinput></screen>
<para>这个例子打印一个当前目录的长长的列表到叫做
<literal>rattan</literal> 的这台打印机:</para>
- <screen>&prompt.user; <userinput><command>ls <option>-l</option> | lpr <option>-P</option> rattan</command></userinput></screen>
+ <screen>&prompt.user; <userinput>ls -l | lpr -P rattan</userinput></screen>
<para>因为没有为
&man.lpr.1; 命令列出文件, <command>lpr</command> 从标准输入读入数据,
在这里是 <command>ls
- <option>-l</option></command> 命令的输出。</para>
+ -l</command> 命令的输出。</para>
<para> &man.lpr.1; 命令同样可以接受多种控制格式的选项,
应用文件转换, 生成多份副本, 等等。
- 要得到更多信息, 参考 <link
- linkend="printing-lpr-options">打印选项</link> 这节。</para>
+ 要得到更多信息, 参考 <link linkend="printing-lpr-options">打印选项</link> 这节。</para>
</sect2>
- <sect2 id="printing-lpq">
+ <sect2 xml:id="printing-lpq">
<title>检查任务</title>
<indexterm><primary>print jobs</primary></indexterm>
@@ -3740,7 +3679,7 @@ total 337.00 154 $ 6.74</screen>
要指定打印机, 使用 <option>-P</option> 选项。
例如, 命令
- <screen>&prompt.user; <userinput><command>lpq <option>-P</option> bamboo</command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpq -P bamboo</userinput></screen>
会显示打印机 <literal>bamboo</literal> 的队列。
下面是命令 <command>lpq</command>
@@ -3756,8 +3695,7 @@ active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes
第一个任务, 用户 kelly 提交的, 标识 <quote>任务编号</quote>
9。 每个要打印的任务都会获得一个不同的任务编号。
大多时候可以忽略这个任务编号, 但在您需要取消任务时会用到这个号码;
- 参考 <link
- linkend="printing-lprm">移除任务</link> 这节得到更多信息。</para>
+ 参考 <link linkend="printing-lprm">移除任务</link> 这节得到更多信息。</para>
<para>编号为 9 的任务包含了两个文件; 在
&man.lpr.1; 命令行中指定的多个文件被看作是一个单个的任务。
@@ -3765,7 +3703,7 @@ active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes
在 <quote>Rank</quote> 这列下面), 意思是打印机当前正在打印那个任务。
第二个任务包含了标准输入传给
&man.lpr.1; 命令的数据。
- 第三个任务来自用户 <username>mary</username>; ,
+ 第三个任务来自用户 <systemitem class="username">mary</systemitem>; ,
它是一个比较大的任务。 她要打印的文件的路径名太长了,
所以 &man.lpq.1; 命令只显示了三个点。</para>
@@ -3775,7 +3713,7 @@ active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes
<para> &man.lpq.1; 命令同样支持 <option>-l</option> 选项来生成一个详细的长列表。
下面是一个
- <command>lpq <option>-l</option></command> 命令的例子:</para>
+ <command>lpq -l</command> 命令的例子:</para>
<screen>waiting for bamboo to become ready (offline ?)
kelly: 1st [job 009rose]
@@ -3789,7 +3727,7 @@ mary: 3rd [job 011rose]
/home/orchid/mary/research/venus/alpha-regio/mapping 78519 bytes</screen>
</sect2>
- <sect2 id="printing-lprm">
+ <sect2 xml:id="printing-lprm">
<title>移除任务</title>
<para>如果您对一个打印任务改变了主意,
@@ -3799,13 +3737,13 @@ mary: 3rd [job 011rose]
<para>要从默认打印机中移除一个任务, 首先使用
&man.lpq.1; 找到任务编号。 然后输入:</para>
- <screen>&prompt.user; <userinput><command>lprm <replaceable>job-number</replaceable></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lprm job-number</userinput></screen>
<para>要从指定打印机中删除任务, 增加
<option>-P</option> 选项。 下面的命令会删除编号为
10 的任务从 <literal>bamboo</literal> 这台打印机:</para>
- <screen>&prompt.user; <userinput><command>lprm <option>-P</option> bamboo 10</command></userinput></screen>
+ <screen>&prompt.user; <userinput>lprm -P bamboo 10</userinput></screen>
<para> &man.lprm.1; 命令有一些快捷方式:</para>
@@ -3843,7 +3781,7 @@ mary: 3rd [job 011rose]
例如, 下面的命令会删除当前用户在打印机
<literal>rattan</literal> 队列中的所有任务:</para>
- <screen>&prompt.user; <userinput><command>lprm <option>-P</option> rattan -</command></userinput></screen>
+ <screen>&prompt.user; <userinput>lprm -P rattan -</userinput></screen>
<note>
<para>如果您正工作在一个网络环境中, &man.lprm.1;
@@ -3851,23 +3789,23 @@ mary: 3rd [job 011rose]
甚至是同一台打印机也可以在其他主机上使用时。
下面的命令证明了这个:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-P</option> rattan <filename><replaceable>myfile</replaceable></filename></command></userinput>
-&prompt.user; <userinput><command>rlogin orchid</command></userinput>
-&prompt.user; <userinput><command>lpq <option>-P</option> rattan</command></userinput>
+ <screen>&prompt.user; <userinput>lpr -P rattan myfile</userinput>
+&prompt.user; <userinput>rlogin orchid</userinput>
+&prompt.user; <userinput>lpq -P rattan</userinput>
Rank Owner Job Files Total Size
active seeyan 12 ... 49123 bytes
2nd kelly 13 myfile 12 bytes
-&prompt.user; <userinput><command>lprm <option>-P</option> rattan 13</command></userinput>
+&prompt.user; <userinput>lprm -P rattan 13</userinput>
rose: Permission denied
-&prompt.user; <userinput><command>logout</command></userinput>
-&prompt.user; <userinput><command>lprm <option>-P</option> rattan 13</command></userinput>
+&prompt.user; <userinput>logout</userinput>
+&prompt.user; <userinput>lprm -P rattan 13</userinput>
dfA013rose dequeued
cfA013rose dequeued
</screen>
</note>
</sect2>
- <sect2 id="printing-lpr-options">
+ <sect2 xml:id="printing-lpr-options">
<title>超越纯文本:打印选项</title>
<para> &man.lpr.1; 支持许多控制文本格式的参数,
@@ -3875,7 +3813,7 @@ cfA013rose dequeued
生成多份副本, 处理任务, 等等。
这一节将描述这些选项。</para>
- <sect3 id="printing-lpr-options-format">
+ <sect3 xml:id="printing-lpr-options-format">
<title>格式与转换选项</title>
<para>下面的 &man.lpr.1; 参数控制任务中文件的格式。
@@ -3885,10 +3823,10 @@ cfA013rose dequeued
<indexterm><primary>&tex;</primary></indexterm>
<para>例如, 下面的命令打印一个 DVI 文件 (来自
- &tex; 排版系统) 文件名为 <filename><replaceable>fish-report.dvi</replaceable></filename>
+ &tex; 排版系统) 文件名为 <filename>fish-report.dvi</filename>
到打印 <literal>bamboo</literal>:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-P</option> bamboo -d <filename><replaceable>fish-report.dvi</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr -P bamboo -d fish-report.dvi</userinput></screen>
<para>这些选项应用到任务中的每个文件, 所以您不能混合
(说) DVI 和 ditroff 文件在同一个任务中。 替代的方法是,
@@ -3898,8 +3836,7 @@ cfA013rose dequeued
<para>所有这些选项除了 <option>-p</option> 和
<option>-T</option> 都需要转换过滤器安装给目标打印机。
例如, <option>-d</option> 选项需要
- DVI 转换过滤器。 参考 <link
- linkend="printing-advanced-convfilters">转换过滤器</link>
+ DVI 转换过滤器。 参考 <link linkend="printing-advanced-convfilters">转换过滤器</link>
这节得到更多细节。</para>
</note>
@@ -4007,7 +3944,7 @@ cfA013rose dequeued
<para>下面是一个例子: 这个命令打印了一个很好的
&man.ls.1; 联机手册到默认打印机:</para>
- <screen>&prompt.user; <userinput><command>zcat <filename>/usr/share/man/man1/ls.1.gz</filename> | troff <option>-t</option> -man | lpr <option>-t</option></command></userinput></screen>
+ <screen>&prompt.user; <userinput>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr -t</userinput></screen>
<para> &man.zcat.1; 命令解压缩
&man.ls.1; 的手册并且将内容传给 &man.troff.1;
@@ -4019,7 +3956,7 @@ cfA013rose dequeued
troff 输出到默认打印机可以理解的格式当任务被打印时。</para>
</sect3>
- <sect3 id="printing-lpr-options-job-handling">
+ <sect3 xml:id="printing-lpr-options-job-handling">
<title>任务处理选项</title>
<para>下面的 &man.lpr.1; 选项告诉
@@ -4034,14 +3971,13 @@ cfA013rose dequeued
替代每个文件一份副本。
管理员可以禁止这个选项来减少打印机的浪费和鼓励复印机的使用。
参考
- <link
- linkend="printing-advanced-restricting-copies">限制多份副本</link>。</para>
+ <link linkend="printing-advanced-restricting-copies">限制多份副本</link>。</para>
<para>这个例子打印三份副本的文件
- <filename><replaceable>parser.c</replaceable></filename> 跟着三份副本的文件
- <filename><replaceable>parser.h</replaceable></filename> 到默认打印机:</para>
+ <filename>parser.c</filename> 跟着三份副本的文件
+ <filename>parser.h</filename> 到默认打印机:</para>
- <screen>&prompt.user; <userinput><command>lpr <option>-#3</option> <filename><replaceable>parser.c parser.h</replaceable></filename></command></userinput></screen>
+ <screen>&prompt.user; <userinput>lpr -#3 parser.c parser.h</userinput></screen>
</listitem>
</varlistentry>
@@ -4099,7 +4035,7 @@ cfA013rose dequeued
</variablelist>
</sect3>
- <sect3 id="printing-lpr-options-misc">
+ <sect3 xml:id="printing-lpr-options-misc">
<title>报头页选项</title>
<para>这些 &man.lpr.1; 的选项调整了通常出现在任务报头页上的文本。
@@ -4138,8 +4074,7 @@ cfA013rose dequeued
<note>
<para>在某些地点, 这个选项可能无效,
- 与报头页的产生方法有关。 参考 <link
- linkend="printing-advanced-header-pages">报头页</link>
+ 与报头页的产生方法有关。 参考 <link linkend="printing-advanced-header-pages">报头页</link>
得到详细信息。</para>
</note>
</listitem>
@@ -4148,7 +4083,7 @@ cfA013rose dequeued
</sect3>
</sect2>
- <sect2 id="printing-lpc">
+ <sect2 xml:id="printing-lpc">
<title>管理打印机</title>
<para>作为一个打印机的管理者, 您必须要安装,
@@ -4176,12 +4111,12 @@ cfA013rose dequeued
<emphasis>启动</emphasis> 或者队列被清空。</para>
<para>如果一个队列被 <emphasis>禁止</emphasis>, 没有用户 (除了
- <username>root</username>) 可以提交任务到打印机。 一个
+ <systemitem class="username">root</systemitem>) 可以提交任务到打印机。 一个
<emphasis>启用</emphasis> 的队列允许任务被提交。
一个打印机可以被 <emphasis>启动</emphasis> 但它的队列被禁止,
在这种情况下打印机将打印队列中的任务, 直到队列为空。</para>
- <para>通常, 您必须有 <username>root</username> 权限来使用
+ <para>通常, 您必须有 <systemitem class="username">root</systemitem> 权限来使用
&man.lpc.8; 命令。 普通用户可以使用 &man.lpc.8;
命令来获得打印机状态并且重启一台挂了的打印机。</para>
@@ -4194,7 +4129,7 @@ cfA013rose dequeued
<variablelist>
<varlistentry>
<term><command>abort
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>取消当前任务并停止打印机。
@@ -4204,7 +4139,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>clean
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>从打印机的后台打印队列目录移除旧的文件。
@@ -4217,25 +4152,25 @@ cfA013rose dequeued
<varlistentry>
<term><command>disable
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>禁止新任务入队。 如果打印机正在工作,
它将会继续打印队列中剩余的任务。
- 超级用户 (<username>root</username>) 总是可以提交任务,
+ 超级用户 (<systemitem class="username">root</systemitem>) 总是可以提交任务,
甚至提交到一个禁止的队列。</para>
<para>这个命令在测试一台新打印机或者安装过滤器时非常有用:
禁止队列并提交以
- <username>root</username> 提交任务。
+ <systemitem class="username">root</systemitem> 提交任务。
其他用户将不能提交任务直到您完成了测试并用命令
<command>enable</command> 重新启用了队列的时候。</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>down <replaceable>printer-name</replaceable>
- <replaceable>message</replaceable></command></term>
+ <term><command>down printer-name
+ message</command></term>
<listitem>
<para>打印机下线。 等于
@@ -4248,7 +4183,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>enable
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>为打印机开启队列。
@@ -4258,7 +4193,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>help
- <replaceable>command-name</replaceable></command></term>
+ command-name</command></term>
<listitem>
<para>打印关于
@@ -4270,7 +4205,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>restart
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>启动打印机。 普通用户可以使用这个命令,
@@ -4286,7 +4221,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>start
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>启用打印机。 打印机将开始打印队列中的任务。</para>
@@ -4295,7 +4230,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>stop
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>停止打印机。 打印机将完成当前任务并且将不再打印队列中的任务任务。
@@ -4305,8 +4240,8 @@ cfA013rose dequeued
</varlistentry>
<varlistentry>
- <term><command>topq <replaceable>printer-name</replaceable>
- <replaceable>job-or-username</replaceable></command></term>
+ <term><command>topq printer-name
+ job-or-username</command></term>
<listitem>
<para>重新以
@@ -4321,7 +4256,7 @@ cfA013rose dequeued
<varlistentry>
<term><command>up
- <replaceable>printer-name</replaceable></command></term>
+ printer-name</command></term>
<listitem>
<para>打印机上线; 相对于
@@ -4339,7 +4274,7 @@ cfA013rose dequeued
</sect2>
</sect1>
- <sect1 id="printing-lpd-alternatives">
+ <sect1 xml:id="printing-lpd-alternatives">
<title>替换标准后台打印</title>
<para>如果您已经通读过了这个手册,
@@ -4362,8 +4297,7 @@ cfA013rose dequeued
是一个完全重写的 PLP。 Patrick Powell
和 Justin Mason (PLP 维护的主要负责人) 合作完成了
<application>LPRng</application>。
- <application>LPRng</application> 的主站是 <ulink
- url="http://www.lprng.org/"></ulink>。</para>
+ <application>LPRng</application> 的主站是 <uri xlink:href="http://www.lprng.org/">http://www.lprng.org/</uri>。</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -4388,8 +4322,7 @@ cfA013rose dequeued
(<acronym>PPD</acronym>) 的打印选项来支持
&unix; 下的真实打印。</para>
- <para><application>CUPS</application> 的主站是 <ulink
- url="http://www.cups.org/"></ulink>。</para>
+ <para><application>CUPS</application> 的主站是 <uri xlink:href="http://www.cups.org/">http://www.cups.org/</uri>。</para>
</listitem>
</varlistentry>
@@ -4405,13 +4338,13 @@ cfA013rose dequeued
打印系统作为后端来提供一些打印方面的功能。</para>
<para><application>HPLIP</application>
- 的主页位于 <ulink url="http://hplipopensource.com/hplip-web/index.html"></ulink>。</para>
+ 的主页位于 <uri xlink:href="http://hplipopensource.com/hplip-web/index.html">http://hplipopensource.com/hplip-web/index.html</uri>。</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
- <sect1 id="printing-troubleshooting">
+ <sect1 xml:id="printing-troubleshooting">
<title>疑难问题</title>
<para>在使用 &man.lptest.1; 进行简单的测试之后,
@@ -4550,7 +4483,7 @@ printf "\033&amp;k2G" &amp;&amp; cat &amp;&amp; printf "\033&amp;l0H" &amp;&amp;
exit 2</programlisting>
<para>下面是一个 <filename>/etc/printcap</filename> 文件的例子在叫做
- <hostid>orchid</hostid> 的主机上。 它只有一台打印机连接在第一个并口上,
+ <systemitem>orchid</systemitem> 的主机上。 它只有一台打印机连接在第一个并口上,
一台 Hewlett Packard
LaserJet 3Si 名字叫做 <literal>teak</literal>。 它使用上面那段脚本作为文本过滤器:</para>
@@ -4558,7 +4491,7 @@ exit 2</programlisting>
# /etc/printcap for host orchid
#
teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:sh:sd=<filename class="directory">/var/spool/lpd/teak</filename>:mx#0:\
+ :lp=<filename>/dev/lpt0</filename>:sh:sd=<filename>/var/spool/lpd/teak</filename>:mx#0:\
:if=<filename>/usr/local/libexec/hpif</filename>:</programlisting>
</listitem>
</itemizedlist>
@@ -4663,8 +4596,8 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
<literal>lf</literal> 变量:</para>
<programlisting>rattan|line|diablo|lp|Diablo 630 Line Printer:\
- :sh:sd=<filename class="directory">/var/spool/lpd/rattan</filename>:\
- :lp=<filename class="devicefile">/dev/lpt0</filename>:\
+ :sh:sd=<filename>/var/spool/lpd/rattan</filename>:\
+ :lp=<filename>/dev/lpt0</filename>:\
:if=<filename>/usr/local/libexec/if-simple</filename>:\
:lf=<filename>/var/log/rattan.log</filename></programlisting>
@@ -4675,7 +4608,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\
<para>如果您没有指定 <literal>lf</literal> 变量,
<application>LPD</application> 会使用
- <filename class="devicefile">/dev/console</filename> 作为默认值。</para>
+ <filename>/dev/console</filename> 作为默认值。</para>
</listitem>
</varlistentry>
</variablelist>