<ulink url="...man.cgi?...">...</ulink> -> <citerefentry>...</citerefentry>

This commit is contained in:
Nik Clayton 1998-08-25 09:06:27 +00:00
parent bab9c37eab
commit 775d061074
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=3413
4 changed files with 590 additions and 501 deletions
en/handbook
en_US.ISO8859-1/books/handbook
en_US.ISO_8859-1/books/handbook

View file

@ -323,3 +323,8 @@ for example,
and near it. Most of the time this consisted of replacing the <emphasis>
with <replaceable> or <userinput>.
29. Fixed up more references to manpages that used <ulink> to use
<citerefentry>. These were missed at step 24 because they didn't
include a section number. No references to man.cgi now exist in
handbook.sgml.

View file

@ -6989,8 +6989,8 @@
<orderedlist>
<listitem>
<para>Become root with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>
<para>Become root with the <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>
command. Enter the root password when prompted.
</para>
</listitem>
@ -7066,8 +7066,8 @@
works.</para>
<para>You can set the communications mode in two ways: by
configuring the kernel or by using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink></para>
configuring the kernel or by using the <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry></para>
<para>program.</para>
@ -7120,8 +7120,8 @@
</para>
<para><emphasis remap=bf>To set the communications mode
with</emphasis> <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink>:
with</emphasis> <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry>:
<itemizedlist>
<listitem>
@ -7159,8 +7159,8 @@
<para>To test the printer, we will send some text to it. For
printers that can immediately print characters sent to them,
the program <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
the program <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
<para>For a PostScript (or other language-based) printer, we
will need a more sophisticated test. A small PostScript
@ -7195,8 +7195,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.</para>
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.</para>
</listitem>
<listitem>
@ -7205,8 +7205,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen><userinput>lptest &gt;
/dev/lpt<replaceable>N</replaceable></userinput></screen>
@ -7267,8 +7267,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.
</para>
</listitem>
@ -7295,8 +7295,8 @@
</listitem>
<listitem>
<para>Connect to the printer with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?tip">tip</ulink>. Type:
<para>Connect to the printer with <citerefentry>
<refentrytitle>tip</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>tip printer</screen>
</informalexample> If this step does not work, edit
@ -7312,8 +7312,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>~$lptest</screen>
</informalexample>
@ -7375,8 +7375,8 @@
reads this file each time the spooler is used, so updates to the
file take immediate effect.</para>
<para>The format of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?printcap">printcap</ulink> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The format of the <citerefentry>
<refentrytitle>printcap</refentrytitle></citerefentry> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The simple spooler configuration consists of the following
steps:
@ -7431,8 +7431,9 @@
</listitem>
<listitem>
<para>Test the setup by printing something with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para>Test the setup by printing something with the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command; see <xref linkend="printing-trying" remap="Trying
It Out"> and <xref linkend="printing-troubleshooting"
remap="Troubleshooting">.</para>
@ -7557,8 +7558,8 @@
is customary to put these directories under
<filename>/var/spool</filename>. It is not necessary to
backup the contents of spooling directories, either.
Recreating them is as simple as running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?mkdir">mkdir</ulink>.</para>
Recreating them is as simple as running <citerefentry>
<refentrytitle>mkdir</refentrytitle></citerefentry>.</para>
<para>It is also customary to make the directory with a name
that is identical to the name of the printer, as shown below:
@ -7846,14 +7847,14 @@
Unfortunately, congratulations are not quite yet in order,
since we still have to test the setup and correct any
problems. To test the setup, try printing something. To
print with the LPD system, you use the command <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
print with the LPD system, you use the command <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits a job for printing.</para>
<para>You can combine <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> program, introduced in section <xref linkend="printing-testing"
<para>You can combine <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
with the <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> program, introduced in section <xref linkend="printing-testing"
remap="Checking Printer Communications"> to generate some
test text.</para>
@ -7867,16 +7868,16 @@
</informalexample> where <emphasis
remap=it>printer-name</emphasis> is a the name of a printer
(or an alias) specified in <filename>/etc/printcap</filename>.
To test the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
To test the default printer, type <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
without any <option>-P</option> argument. Again, if you are
testing a printer that expects PostScript, send a PostScript
program in that language instead of using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
program in that language instead of using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
<para>For a PostScript printer, you should get the results of
the program. If you are using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, then your results should look like the following:</para>
the program. If you are using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, then your results should look like the following:</para>
<para>
<informalexample>
@ -7889,8 +7890,8 @@
<para>To further test the printer, try downloading larger
programs (for language-based printers) or running</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para><citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para>If the printer did not work, see the next section, <xref
linkend="printing-troubleshooting"
@ -7902,8 +7903,8 @@
id="printing-troubleshooting">
<title>Troubleshooting</title>
<para> After performing the simple test with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, you might have gotten one of the following results instead of the correct printout:
<para> After performing the simple test with <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, you might have gotten one of the following results instead of the correct printout:
<variablelist>
<varlistentry><term>It worked, after awhile; or, it did not
eject a full sheet.</term>
@ -8198,23 +8199,23 @@
<para> This section tells you how to use printers you have setup with
FreeBSD. Here is an overview of the user-level commands:
<variablelist>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry></term>
<listitem>
<para>Print jobs</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry></term>
<listitem>
<para>Check printer queues</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry></term>
<listitem>
<para>Remove jobs from a printer's queue</para>
@ -8223,16 +8224,17 @@
</variablelist>
</para>
<para>There is also an administrative command, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>,
<para>There is also an administrative command, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>,
described in the section <xref linkend="printing-lpc"
remap="Administrating the
LPD Spooler">, used to control printers and their queues.</para>
<para>All three of the commands <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>, and
<ulink URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<para>All three of the commands <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>, and
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
accept an option <option>-P</option> <emphasis
remap=it>printer-name</emphasis> to specify on which
printer/queue to operate, as listed in the
@ -8259,8 +8261,8 @@
<screen><userinput>lpr
<replaceable>filename...</replaceable></userinput></screen>
</informalexample> This prints each of the listed files to the
default printer. If you list no files, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> reads
default printer. If you list no files, <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> reads
data to print from standard input. For example, this command
prints some important system files:
<informalexample>
@ -8273,14 +8275,15 @@
current directory to the printer named <hostid>rattan</hostid>:
<informalexample>
<screen>ls -l | lpr -P rattan</screen>
</informalexample> Because no files were listed for the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
</informalexample> Because no files were listed for the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command, <command>lpr</command> read the data to print
from standard input, which was the output of the <command>ls
-l</command> command.</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para>The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
can also accept a wide variety of options to control formatting,
apply file conversions, generate multiple copies, and so forth.
For more information, see the section <xref
@ -8293,8 +8296,8 @@
id="printing-lpq">
<title>Checking Jobs</title>
<para> When you print with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para> When you print with <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
data you wish to print is put together in a package called a
<emphasis>print job</emphasis>, which is sent to the LPD spooling
system. Each printer has a queue of jobs, and your job waits in
@ -8302,8 +8305,9 @@
users. The printer prints those jobs in a first-come, first-served
order.</para>
<para>To display the queue for the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>. For a
<para>To display the queue for the default printer, type
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>. For a
specific printer, use the <option>-P</option> option. For
example, the command
<informalexample>
@ -8326,29 +8330,29 @@
details.</para>
<para>Job number nine consists of two files; multiple files given on
the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
line are treated as part of a single job. It is the currently
active job (note the word <literal>active</literal>
under the <quote>Rank</quote> column), which means the printer should be
currently printing that job. The second job consists of data
passed as the standard input to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command. The third job came from user mary; it is a much larger
job. The pathname of the files she's trying to print is too long
to fit, so the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
to fit, so the <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
just shows three dots.</para>
<para>The very first line of the output from <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> is also
<para>The very first line of the output from <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> is also
useful: it tells what the printer is currently doing (or at least
what LPD thinks the printer is doing).</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
<para>The <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
also support a <option>-l</option> option to generate a detailed
long listing. Here is an example of <command>lpq -l</command>:
<informalexample>
@ -8370,15 +8374,16 @@
<title>Removing Jobs</title>
<para> If you change your mind about printing a job, you can remove
the job from the queue with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
command. Often, you can even use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> to
the job from the queue with the <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command. Often, you can even use <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> to
remove an active job, but some or all of the job might still get
printed.</para>
<para>To remove a job from the default printer, first use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> to find
<para>To remove a job from the default printer, first use
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> to find
the job number. Then type
<informalexample>
<screen><userinput>lprm
@ -8388,8 +8393,8 @@
number 10 from the queue for the printer <hostid>bamboo</hostid>:
<informalexample>
<screen>lprm -P bamboo 10</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
</informalexample> The <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command has a few shortcuts:
<variablelist>
<varlistentry><term>lprm -</term>
@ -8415,8 +8420,8 @@
<listitem>
<para>With no job number, user name, or
<option>-</option> appearing on the command line,
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
<citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
</listitem>
</varlistentry>
@ -8438,8 +8443,8 @@
<para>If you are working in a networked
environment,</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
<para><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
will let you remove jobs only from the host from which the jobs
were submitted, even if the same printer is available from other
hosts. The following command sequence demonstrates this:
@ -8460,8 +8465,8 @@
id="printing-lpr-options">
<title>Beyond Plain Text: Printing Options</title>
<para> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para> The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
supports a number of options that control formatting text,
converting graphic and other file formats, producing multiple
copies, handling of the job, and more. This section describes the
@ -8472,12 +8477,12 @@
id="printing-lpr-options-format">
<title>Formatting and Conversion Options</title>
<para> The following <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> The following <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options control formatting of the files in the job. Use these
options if the job does not contain plain text or if you want
plain text formatted through the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
plain text formatted through the <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
utility.</para>
<para>For example, the following command prints a DVI file (from
@ -8565,8 +8570,8 @@
<varlistentry><term>-p</term>
<listitem>
<para>Format plain text with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<para>Format plain text with <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
before printing. See <citerefentry><refentrytitle>pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more information.</para>
</listitem>
</varlistentry>
@ -8576,8 +8581,8 @@
<listitem>
<para>Use <emphasis remap=it>title</emphasis> on the
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
header instead of the file name. This option has effect
only when used with the <option>-p</option>
option.</para>
@ -8601,28 +8606,28 @@
</para>
<para>Here is an example: this command prints a nicely formatted
version of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
version of the <citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page on the default printer:
<informalexample>
<screen>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr
-t</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?zcat">zcat</ulink>
</informalexample> The <citerefentry>
<refentrytitle>zcat</refentrytitle></citerefentry>
command uncompresses the source of the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
page and passes it to the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?troff">troff</ulink>
<para><citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page and passes it to the <citerefentry>
<refentrytitle>troff</refentrytitle></citerefentry>
command, which formats that source and makes GNU troff output
and passes it to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
and passes it to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits the job to the LPD spooler. Because we used the
<option>-t</option> option to</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
spooler will convert the GNU troff output into a format the
default printer can understand when it prints the job.</para>
@ -8632,8 +8637,8 @@
id="printing-lpr-options-job-handling">
<title>Job Handling Options</title>
<para> The following options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> tell
<para> The following options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> tell
LPD to handle the job specially:</para>
<para>
@ -8717,8 +8722,8 @@
id="printing-lpr-options-misc">
<title>Header Page Options</title>
<para> These options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> These options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
adjust the text that normally appears on a job's header page.
If header pages are suppressed for the destination printer,
these options have no effect. See section <xref
@ -8772,13 +8777,13 @@
<title>Administrating Printers</title>
<para> As an administrator for your printers, you have had to
install, set up, and test them. Using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
install, set up, and test them. Using the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command, you can interact with your printers in yet more ways.
With</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>, you
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>, you
can</para>
<para>
@ -8816,14 +8821,14 @@
<para>In general, you have to have root privileges to use the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
command. Ordinary users can use the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> command
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command. Ordinary users can use the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> command
to get printer status and to restart a hung printer only.</para>
<para>Here is a summary of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
<para>Here is a summary of the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
commands. Most of the commands takes a <emphasis
remap=it>printer-name</emphasis> argument to tell on which
printer to operate. You can use <literal>all</literal>
@ -8879,8 +8884,8 @@
<para>Take a printer down. Equivalent to <command>disable</command> followed by <command>stop</command>. The <emphasis
remap=it>message</emphasis> appears as the printer's
status whenever a user checks the printer's queue with
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
or status with <command>lpc
status</command>.</para>
</listitem>
@ -8966,11 +8971,11 @@
</variablelist>
</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> accepts
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> accepts
the above commands on the command line. If you do not enter any
commands, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> enters
commands, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> enters
an interactive mode, where you can enter commands until you type
<command>exit</command>, <command>quit</command>, or end-of-file.</para>
@ -9118,8 +9123,8 @@
what is listed in the <filename>/etc/printcap</filename> file
and what arguments the user specified for the job on the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line. For example, if the user typed <command>lpr
-t</command>, LPD would start the troff filter, listed in the
<emphasis remap=tt>tf</emphasis> capability for the destination
@ -9384,8 +9389,8 @@
text-to-PostScript program you wish. The FreeBSD ports
collection (see <xref linkend="ports" remap="The Ports
Collection">) includes a full featured text-to-PostScript
program called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=a2ps">a2ps</ulink> that you might want to investigate.</para>
program called <citerefentry>
<refentrytitle>a2ps</refentrytitle></citerefentry> that you might want to investigate.</para>
</sect3>
@ -9420,8 +9425,8 @@
for Hewlett Packard DeskJet 500 printers. For other printers,
substitute the <option>-sDEVICE</option> argument to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=gs">gs</ulink> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<para><citerefentry>
<refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<informalexample>
<programlisting>#!/bin/sh # # ifhp - Print
Ghostscript-simulated PostScript on a DeskJet 500 #
@ -9571,8 +9576,8 @@
Invoked by lpd when user runs lpr -d # exec
/usr/local/bin/dvips -f | /usr/local/libexec/lprps
"$@"</programlisting>
</informalexample> This script runs <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
</informalexample> This script runs <citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
remap="Accommodating Plain Text Jobs on PostScript
Printers">) with the arguments LPD passed to this script.
<command>lprps</command> will use those arguments
@ -9664,11 +9669,26 @@
<para>Now, for the hard part: making the filter. For that, we
need a DVI-to-LaserJet/PCL conversion program. The FreeBSD
ports collection (see <xref linkend="ports" remap="The
Ports Collection">) has one: <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvi2xx">dvi2xx</ulink> is the name of the package. Installing this package gives us the program we need, <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
Ports Collection">) has one: <citerefentry>
<refentrytitle>dvi2xx</refentrytitle></citerefentry> is the
name of the package. Installing this package gives us the
program we need, <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> makes the filter <command>hpdf</command> quite complex since <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> cannot read from standard input. It wants to work with a filename. What is worse, the filename has to end in <filename>.dvi</filename> so using <filename>/dev/fd/0</filename> for standard input is problematic. We can get around that problem by linking (symbolically) a temporary file name (one that ends in <filename>.dvi</filename>) to <filename>/dev/fd/0</filename>, thereby forcing <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> to read from standard input.</para>
<para><citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> makes
the filter <command>hpdf</command> quite complex since
<citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> cannot
read from standard input. It wants to work with a filename.
What is worse, the filename has to end in
<filename>.dvi</filename> so using
<filename>/dev/fd/0</filename> for standard input is
problematic. We can get around that problem by linking
(symbolically) a temporary file name (one that ends in
<filename>.dvi</filename>) to <filename>/dev/fd/0</filename>,
thereby forcing <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> to read from standard input.</para>
<para>The only other fly in the ointment is the fact that we
cannot use <filename>/tmp</filename> for the temporary link.
@ -9724,8 +9744,8 @@
<para> All these conversion filters accomplish a lot for your
printing environment, but at the cost forcing the user to
specify (on the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
specify (on the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line) which one to use. If your users are not
particularly computer literate, having to specify a filter
option will become annoying. What is worse, though, is that
@ -9743,8 +9763,8 @@
you can still provide conversion filters just for them.</para>
<para>The FreeBSD ports collection has a text filter that
performs automatic conversion called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=apsfilter">apsfilter</ulink>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
performs automatic conversion called <citerefentry>
<refentrytitle>apsfilter</refentrytitle></citerefentry>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
</sect4>
</sect3>
@ -9939,8 +9959,8 @@
they can suppress header pages by submitting the job with
<command>lpr -h</command>; see <xref
linkend="printing-lpr-options-misc" remap="Header Page
Options"> for more <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
Options"> for more <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options.</para>
<note>
@ -10439,8 +10459,8 @@
<para>If you feel multiple copies cause unnecessary wear and tear
on your printers, you can disable the <option>-#</option> option
to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> by
to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> by
adding the <emphasis remap=tt>sc</emphasis> capability to the
<filename>/etc/printcap</filename> file. When users submit jobs
with the <option>-#</option> option, they will see
@ -10491,8 +10511,8 @@
:lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc:</programlisting>
</informalexample> By using the <emphasis remap=tt>sc</emphasis>
capability, we prevent the use of <command>lpr -#</command>, but
that still does not prevent users from running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
that still does not prevent users from running <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
multiple times, or from submitting the same file multiple times
in one job like this:
<informalexample>
@ -10633,7 +10653,11 @@
<para>The format of these files is simple: one host name
per line. Note that the file
<filename>/etc/hosts.equiv</filename> is also used by
the <citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <ulink URL="http://www.freebsd.org/cgi/man.cgi?rsh">rsh</ulink> and <ulink URL="http://www.freebsd.org/cgi/man.cgi?rcp">rcp</ulink>, so be careful.</para>
the
<citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <citerefentry>
<refentrytitle>rsh</refentrytitle></citerefentry> and
<citerefentry>
<refentrytitle>rcp</refentrytitle></citerefentry>, so be careful.</para>
<para>For example, here is the
<filename>/etc/hosts.lpd</filename> file on the host
@ -10802,8 +10826,8 @@
<xref linkend="printing-advanced-lpf" remap="lpf: a Text
Filter">, and</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>, a
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>, a
program to gather and total entries from printer accounting
files.</para>
@ -10839,11 +10863,11 @@
<para>When you are ready to charge users for printouts, run
the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
program. Just change to the spooling directory for the printer
you want to collect on and type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>. You
you want to collect on and type <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>. You
will get a dollar-centric summary like the following:
<informalexample>
<programlisting> Login pages/feet runs
@ -10854,8 +10878,8 @@
rose:mary 87.00 32 $ 1.74 rose:root
26.00 12 $ 0.52 total 337.00 154
$ 6.74</programlisting>
</informalexample> These are the arguments <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
</informalexample> These are the arguments <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
expects:
<variablelist>
<varlistentry><term><option>-P<replaceable>printer</replaceable></option></term>
@ -10926,8 +10950,8 @@
</variablelist>
</para>
<para>In the default summary that <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para>In the default summary that <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
produces, you see the number of pages printed by each user from
various hosts. If, at your site, host does not matter (because
users can use any host), run <command>pac -m</command>, to
@ -10939,14 +10963,16 @@
$ 2.36 root 26.00 12 $ 0.52
zhang 9.00 1 $ 0.18 total
337.00 154 $ 6.74</programlisting>
</informalexample> To compute the dollar amount due, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> uses
</informalexample> To compute the dollar amount due,
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> uses
the <emphasis remap=tt>pc</emphasis> capability in the
<filename>/etc/printcap</filename> file (default of 200, or 2
cents per page). Specify, in hundredths of cents, the price per
page or per foot you want to charge for printouts in this
capability. You can override this value when you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> with
capability. You can override this value when you run
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> with
the <option>-p</option> option. The units for the
<option>-p</option> option are in dollars, though, not
hundredths of cents. For example,
@ -10960,8 +10986,8 @@
summary information in a summary accounting file, which is named
the same as the printer's accounting file, but with
<symbol>_sum</symbol> appended to the name. It then truncates
the accounting file. When you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
the accounting file. When you run <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
again, it rereads the summary file to get starting totals, then
adds information from the regular accounting file.</para>
@ -10992,8 +11018,10 @@
<para>Well, for DVI-to-LaserJet or DVI-to-PostScript conversion,
you can have your filter parse the diagnostic output of</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj">dvilj</ulink> or <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para><citerefentry>
<refentrytitle>dvilj</refentrytitle></citerefentry> or
<citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para>But these methods suffer from the fact that the printer may
not actually print all those pages. For example, it could jam,

View file

@ -6989,8 +6989,8 @@
<orderedlist>
<listitem>
<para>Become root with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>
<para>Become root with the <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>
command. Enter the root password when prompted.
</para>
</listitem>
@ -7066,8 +7066,8 @@
works.</para>
<para>You can set the communications mode in two ways: by
configuring the kernel or by using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink></para>
configuring the kernel or by using the <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry></para>
<para>program.</para>
@ -7120,8 +7120,8 @@
</para>
<para><emphasis remap=bf>To set the communications mode
with</emphasis> <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink>:
with</emphasis> <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry>:
<itemizedlist>
<listitem>
@ -7159,8 +7159,8 @@
<para>To test the printer, we will send some text to it. For
printers that can immediately print characters sent to them,
the program <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
the program <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
<para>For a PostScript (or other language-based) printer, we
will need a more sophisticated test. A small PostScript
@ -7195,8 +7195,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.</para>
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.</para>
</listitem>
<listitem>
@ -7205,8 +7205,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen><userinput>lptest &gt;
/dev/lpt<replaceable>N</replaceable></userinput></screen>
@ -7267,8 +7267,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.
</para>
</listitem>
@ -7295,8 +7295,8 @@
</listitem>
<listitem>
<para>Connect to the printer with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?tip">tip</ulink>. Type:
<para>Connect to the printer with <citerefentry>
<refentrytitle>tip</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>tip printer</screen>
</informalexample> If this step does not work, edit
@ -7312,8 +7312,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>~$lptest</screen>
</informalexample>
@ -7375,8 +7375,8 @@
reads this file each time the spooler is used, so updates to the
file take immediate effect.</para>
<para>The format of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?printcap">printcap</ulink> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The format of the <citerefentry>
<refentrytitle>printcap</refentrytitle></citerefentry> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The simple spooler configuration consists of the following
steps:
@ -7431,8 +7431,9 @@
</listitem>
<listitem>
<para>Test the setup by printing something with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para>Test the setup by printing something with the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command; see <xref linkend="printing-trying" remap="Trying
It Out"> and <xref linkend="printing-troubleshooting"
remap="Troubleshooting">.</para>
@ -7557,8 +7558,8 @@
is customary to put these directories under
<filename>/var/spool</filename>. It is not necessary to
backup the contents of spooling directories, either.
Recreating them is as simple as running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?mkdir">mkdir</ulink>.</para>
Recreating them is as simple as running <citerefentry>
<refentrytitle>mkdir</refentrytitle></citerefentry>.</para>
<para>It is also customary to make the directory with a name
that is identical to the name of the printer, as shown below:
@ -7846,14 +7847,14 @@
Unfortunately, congratulations are not quite yet in order,
since we still have to test the setup and correct any
problems. To test the setup, try printing something. To
print with the LPD system, you use the command <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
print with the LPD system, you use the command <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits a job for printing.</para>
<para>You can combine <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> program, introduced in section <xref linkend="printing-testing"
<para>You can combine <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
with the <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> program, introduced in section <xref linkend="printing-testing"
remap="Checking Printer Communications"> to generate some
test text.</para>
@ -7867,16 +7868,16 @@
</informalexample> where <emphasis
remap=it>printer-name</emphasis> is a the name of a printer
(or an alias) specified in <filename>/etc/printcap</filename>.
To test the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
To test the default printer, type <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
without any <option>-P</option> argument. Again, if you are
testing a printer that expects PostScript, send a PostScript
program in that language instead of using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
program in that language instead of using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
<para>For a PostScript printer, you should get the results of
the program. If you are using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, then your results should look like the following:</para>
the program. If you are using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, then your results should look like the following:</para>
<para>
<informalexample>
@ -7889,8 +7890,8 @@
<para>To further test the printer, try downloading larger
programs (for language-based printers) or running</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para><citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para>If the printer did not work, see the next section, <xref
linkend="printing-troubleshooting"
@ -7902,8 +7903,8 @@
id="printing-troubleshooting">
<title>Troubleshooting</title>
<para> After performing the simple test with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, you might have gotten one of the following results instead of the correct printout:
<para> After performing the simple test with <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, you might have gotten one of the following results instead of the correct printout:
<variablelist>
<varlistentry><term>It worked, after awhile; or, it did not
eject a full sheet.</term>
@ -8198,23 +8199,23 @@
<para> This section tells you how to use printers you have setup with
FreeBSD. Here is an overview of the user-level commands:
<variablelist>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry></term>
<listitem>
<para>Print jobs</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry></term>
<listitem>
<para>Check printer queues</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry></term>
<listitem>
<para>Remove jobs from a printer's queue</para>
@ -8223,16 +8224,17 @@
</variablelist>
</para>
<para>There is also an administrative command, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>,
<para>There is also an administrative command, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>,
described in the section <xref linkend="printing-lpc"
remap="Administrating the
LPD Spooler">, used to control printers and their queues.</para>
<para>All three of the commands <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>, and
<ulink URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<para>All three of the commands <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>, and
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
accept an option <option>-P</option> <emphasis
remap=it>printer-name</emphasis> to specify on which
printer/queue to operate, as listed in the
@ -8259,8 +8261,8 @@
<screen><userinput>lpr
<replaceable>filename...</replaceable></userinput></screen>
</informalexample> This prints each of the listed files to the
default printer. If you list no files, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> reads
default printer. If you list no files, <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> reads
data to print from standard input. For example, this command
prints some important system files:
<informalexample>
@ -8273,14 +8275,15 @@
current directory to the printer named <hostid>rattan</hostid>:
<informalexample>
<screen>ls -l | lpr -P rattan</screen>
</informalexample> Because no files were listed for the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
</informalexample> Because no files were listed for the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command, <command>lpr</command> read the data to print
from standard input, which was the output of the <command>ls
-l</command> command.</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para>The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
can also accept a wide variety of options to control formatting,
apply file conversions, generate multiple copies, and so forth.
For more information, see the section <xref
@ -8293,8 +8296,8 @@
id="printing-lpq">
<title>Checking Jobs</title>
<para> When you print with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para> When you print with <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
data you wish to print is put together in a package called a
<emphasis>print job</emphasis>, which is sent to the LPD spooling
system. Each printer has a queue of jobs, and your job waits in
@ -8302,8 +8305,9 @@
users. The printer prints those jobs in a first-come, first-served
order.</para>
<para>To display the queue for the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>. For a
<para>To display the queue for the default printer, type
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>. For a
specific printer, use the <option>-P</option> option. For
example, the command
<informalexample>
@ -8326,29 +8330,29 @@
details.</para>
<para>Job number nine consists of two files; multiple files given on
the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
line are treated as part of a single job. It is the currently
active job (note the word <literal>active</literal>
under the <quote>Rank</quote> column), which means the printer should be
currently printing that job. The second job consists of data
passed as the standard input to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command. The third job came from user mary; it is a much larger
job. The pathname of the files she's trying to print is too long
to fit, so the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
to fit, so the <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
just shows three dots.</para>
<para>The very first line of the output from <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> is also
<para>The very first line of the output from <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> is also
useful: it tells what the printer is currently doing (or at least
what LPD thinks the printer is doing).</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
<para>The <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
also support a <option>-l</option> option to generate a detailed
long listing. Here is an example of <command>lpq -l</command>:
<informalexample>
@ -8370,15 +8374,16 @@
<title>Removing Jobs</title>
<para> If you change your mind about printing a job, you can remove
the job from the queue with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
command. Often, you can even use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> to
the job from the queue with the <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command. Often, you can even use <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> to
remove an active job, but some or all of the job might still get
printed.</para>
<para>To remove a job from the default printer, first use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> to find
<para>To remove a job from the default printer, first use
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> to find
the job number. Then type
<informalexample>
<screen><userinput>lprm
@ -8388,8 +8393,8 @@
number 10 from the queue for the printer <hostid>bamboo</hostid>:
<informalexample>
<screen>lprm -P bamboo 10</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
</informalexample> The <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command has a few shortcuts:
<variablelist>
<varlistentry><term>lprm -</term>
@ -8415,8 +8420,8 @@
<listitem>
<para>With no job number, user name, or
<option>-</option> appearing on the command line,
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
<citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
</listitem>
</varlistentry>
@ -8438,8 +8443,8 @@
<para>If you are working in a networked
environment,</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
<para><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
will let you remove jobs only from the host from which the jobs
were submitted, even if the same printer is available from other
hosts. The following command sequence demonstrates this:
@ -8460,8 +8465,8 @@
id="printing-lpr-options">
<title>Beyond Plain Text: Printing Options</title>
<para> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para> The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
supports a number of options that control formatting text,
converting graphic and other file formats, producing multiple
copies, handling of the job, and more. This section describes the
@ -8472,12 +8477,12 @@
id="printing-lpr-options-format">
<title>Formatting and Conversion Options</title>
<para> The following <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> The following <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options control formatting of the files in the job. Use these
options if the job does not contain plain text or if you want
plain text formatted through the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
plain text formatted through the <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
utility.</para>
<para>For example, the following command prints a DVI file (from
@ -8565,8 +8570,8 @@
<varlistentry><term>-p</term>
<listitem>
<para>Format plain text with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<para>Format plain text with <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
before printing. See <citerefentry><refentrytitle>pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more information.</para>
</listitem>
</varlistentry>
@ -8576,8 +8581,8 @@
<listitem>
<para>Use <emphasis remap=it>title</emphasis> on the
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
header instead of the file name. This option has effect
only when used with the <option>-p</option>
option.</para>
@ -8601,28 +8606,28 @@
</para>
<para>Here is an example: this command prints a nicely formatted
version of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
version of the <citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page on the default printer:
<informalexample>
<screen>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr
-t</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?zcat">zcat</ulink>
</informalexample> The <citerefentry>
<refentrytitle>zcat</refentrytitle></citerefentry>
command uncompresses the source of the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
page and passes it to the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?troff">troff</ulink>
<para><citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page and passes it to the <citerefentry>
<refentrytitle>troff</refentrytitle></citerefentry>
command, which formats that source and makes GNU troff output
and passes it to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
and passes it to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits the job to the LPD spooler. Because we used the
<option>-t</option> option to</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
spooler will convert the GNU troff output into a format the
default printer can understand when it prints the job.</para>
@ -8632,8 +8637,8 @@
id="printing-lpr-options-job-handling">
<title>Job Handling Options</title>
<para> The following options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> tell
<para> The following options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> tell
LPD to handle the job specially:</para>
<para>
@ -8717,8 +8722,8 @@
id="printing-lpr-options-misc">
<title>Header Page Options</title>
<para> These options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> These options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
adjust the text that normally appears on a job's header page.
If header pages are suppressed for the destination printer,
these options have no effect. See section <xref
@ -8772,13 +8777,13 @@
<title>Administrating Printers</title>
<para> As an administrator for your printers, you have had to
install, set up, and test them. Using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
install, set up, and test them. Using the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command, you can interact with your printers in yet more ways.
With</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>, you
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>, you
can</para>
<para>
@ -8816,14 +8821,14 @@
<para>In general, you have to have root privileges to use the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
command. Ordinary users can use the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> command
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command. Ordinary users can use the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> command
to get printer status and to restart a hung printer only.</para>
<para>Here is a summary of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
<para>Here is a summary of the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
commands. Most of the commands takes a <emphasis
remap=it>printer-name</emphasis> argument to tell on which
printer to operate. You can use <literal>all</literal>
@ -8879,8 +8884,8 @@
<para>Take a printer down. Equivalent to <command>disable</command> followed by <command>stop</command>. The <emphasis
remap=it>message</emphasis> appears as the printer's
status whenever a user checks the printer's queue with
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
or status with <command>lpc
status</command>.</para>
</listitem>
@ -8966,11 +8971,11 @@
</variablelist>
</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> accepts
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> accepts
the above commands on the command line. If you do not enter any
commands, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> enters
commands, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> enters
an interactive mode, where you can enter commands until you type
<command>exit</command>, <command>quit</command>, or end-of-file.</para>
@ -9118,8 +9123,8 @@
what is listed in the <filename>/etc/printcap</filename> file
and what arguments the user specified for the job on the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line. For example, if the user typed <command>lpr
-t</command>, LPD would start the troff filter, listed in the
<emphasis remap=tt>tf</emphasis> capability for the destination
@ -9384,8 +9389,8 @@
text-to-PostScript program you wish. The FreeBSD ports
collection (see <xref linkend="ports" remap="The Ports
Collection">) includes a full featured text-to-PostScript
program called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=a2ps">a2ps</ulink> that you might want to investigate.</para>
program called <citerefentry>
<refentrytitle>a2ps</refentrytitle></citerefentry> that you might want to investigate.</para>
</sect3>
@ -9420,8 +9425,8 @@
for Hewlett Packard DeskJet 500 printers. For other printers,
substitute the <option>-sDEVICE</option> argument to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=gs">gs</ulink> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<para><citerefentry>
<refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<informalexample>
<programlisting>#!/bin/sh # # ifhp - Print
Ghostscript-simulated PostScript on a DeskJet 500 #
@ -9571,8 +9576,8 @@
Invoked by lpd when user runs lpr -d # exec
/usr/local/bin/dvips -f | /usr/local/libexec/lprps
"$@"</programlisting>
</informalexample> This script runs <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
</informalexample> This script runs <citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
remap="Accommodating Plain Text Jobs on PostScript
Printers">) with the arguments LPD passed to this script.
<command>lprps</command> will use those arguments
@ -9664,11 +9669,26 @@
<para>Now, for the hard part: making the filter. For that, we
need a DVI-to-LaserJet/PCL conversion program. The FreeBSD
ports collection (see <xref linkend="ports" remap="The
Ports Collection">) has one: <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvi2xx">dvi2xx</ulink> is the name of the package. Installing this package gives us the program we need, <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
Ports Collection">) has one: <citerefentry>
<refentrytitle>dvi2xx</refentrytitle></citerefentry> is the
name of the package. Installing this package gives us the
program we need, <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> makes the filter <command>hpdf</command> quite complex since <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> cannot read from standard input. It wants to work with a filename. What is worse, the filename has to end in <filename>.dvi</filename> so using <filename>/dev/fd/0</filename> for standard input is problematic. We can get around that problem by linking (symbolically) a temporary file name (one that ends in <filename>.dvi</filename>) to <filename>/dev/fd/0</filename>, thereby forcing <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> to read from standard input.</para>
<para><citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> makes
the filter <command>hpdf</command> quite complex since
<citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> cannot
read from standard input. It wants to work with a filename.
What is worse, the filename has to end in
<filename>.dvi</filename> so using
<filename>/dev/fd/0</filename> for standard input is
problematic. We can get around that problem by linking
(symbolically) a temporary file name (one that ends in
<filename>.dvi</filename>) to <filename>/dev/fd/0</filename>,
thereby forcing <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> to read from standard input.</para>
<para>The only other fly in the ointment is the fact that we
cannot use <filename>/tmp</filename> for the temporary link.
@ -9724,8 +9744,8 @@
<para> All these conversion filters accomplish a lot for your
printing environment, but at the cost forcing the user to
specify (on the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
specify (on the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line) which one to use. If your users are not
particularly computer literate, having to specify a filter
option will become annoying. What is worse, though, is that
@ -9743,8 +9763,8 @@
you can still provide conversion filters just for them.</para>
<para>The FreeBSD ports collection has a text filter that
performs automatic conversion called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=apsfilter">apsfilter</ulink>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
performs automatic conversion called <citerefentry>
<refentrytitle>apsfilter</refentrytitle></citerefentry>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
</sect4>
</sect3>
@ -9939,8 +9959,8 @@
they can suppress header pages by submitting the job with
<command>lpr -h</command>; see <xref
linkend="printing-lpr-options-misc" remap="Header Page
Options"> for more <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
Options"> for more <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options.</para>
<note>
@ -10439,8 +10459,8 @@
<para>If you feel multiple copies cause unnecessary wear and tear
on your printers, you can disable the <option>-#</option> option
to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> by
to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> by
adding the <emphasis remap=tt>sc</emphasis> capability to the
<filename>/etc/printcap</filename> file. When users submit jobs
with the <option>-#</option> option, they will see
@ -10491,8 +10511,8 @@
:lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc:</programlisting>
</informalexample> By using the <emphasis remap=tt>sc</emphasis>
capability, we prevent the use of <command>lpr -#</command>, but
that still does not prevent users from running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
that still does not prevent users from running <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
multiple times, or from submitting the same file multiple times
in one job like this:
<informalexample>
@ -10633,7 +10653,11 @@
<para>The format of these files is simple: one host name
per line. Note that the file
<filename>/etc/hosts.equiv</filename> is also used by
the <citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <ulink URL="http://www.freebsd.org/cgi/man.cgi?rsh">rsh</ulink> and <ulink URL="http://www.freebsd.org/cgi/man.cgi?rcp">rcp</ulink>, so be careful.</para>
the
<citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <citerefentry>
<refentrytitle>rsh</refentrytitle></citerefentry> and
<citerefentry>
<refentrytitle>rcp</refentrytitle></citerefentry>, so be careful.</para>
<para>For example, here is the
<filename>/etc/hosts.lpd</filename> file on the host
@ -10802,8 +10826,8 @@
<xref linkend="printing-advanced-lpf" remap="lpf: a Text
Filter">, and</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>, a
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>, a
program to gather and total entries from printer accounting
files.</para>
@ -10839,11 +10863,11 @@
<para>When you are ready to charge users for printouts, run
the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
program. Just change to the spooling directory for the printer
you want to collect on and type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>. You
you want to collect on and type <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>. You
will get a dollar-centric summary like the following:
<informalexample>
<programlisting> Login pages/feet runs
@ -10854,8 +10878,8 @@
rose:mary 87.00 32 $ 1.74 rose:root
26.00 12 $ 0.52 total 337.00 154
$ 6.74</programlisting>
</informalexample> These are the arguments <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
</informalexample> These are the arguments <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
expects:
<variablelist>
<varlistentry><term><option>-P<replaceable>printer</replaceable></option></term>
@ -10926,8 +10950,8 @@
</variablelist>
</para>
<para>In the default summary that <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para>In the default summary that <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
produces, you see the number of pages printed by each user from
various hosts. If, at your site, host does not matter (because
users can use any host), run <command>pac -m</command>, to
@ -10939,14 +10963,16 @@
$ 2.36 root 26.00 12 $ 0.52
zhang 9.00 1 $ 0.18 total
337.00 154 $ 6.74</programlisting>
</informalexample> To compute the dollar amount due, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> uses
</informalexample> To compute the dollar amount due,
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> uses
the <emphasis remap=tt>pc</emphasis> capability in the
<filename>/etc/printcap</filename> file (default of 200, or 2
cents per page). Specify, in hundredths of cents, the price per
page or per foot you want to charge for printouts in this
capability. You can override this value when you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> with
capability. You can override this value when you run
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> with
the <option>-p</option> option. The units for the
<option>-p</option> option are in dollars, though, not
hundredths of cents. For example,
@ -10960,8 +10986,8 @@
summary information in a summary accounting file, which is named
the same as the printer's accounting file, but with
<symbol>_sum</symbol> appended to the name. It then truncates
the accounting file. When you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
the accounting file. When you run <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
again, it rereads the summary file to get starting totals, then
adds information from the regular accounting file.</para>
@ -10992,8 +11018,10 @@
<para>Well, for DVI-to-LaserJet or DVI-to-PostScript conversion,
you can have your filter parse the diagnostic output of</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj">dvilj</ulink> or <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para><citerefentry>
<refentrytitle>dvilj</refentrytitle></citerefentry> or
<citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para>But these methods suffer from the fact that the printer may
not actually print all those pages. For example, it could jam,

View file

@ -6989,8 +6989,8 @@
<orderedlist>
<listitem>
<para>Become root with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>
<para>Become root with the <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>
command. Enter the root password when prompted.
</para>
</listitem>
@ -7066,8 +7066,8 @@
works.</para>
<para>You can set the communications mode in two ways: by
configuring the kernel or by using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink></para>
configuring the kernel or by using the <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry></para>
<para>program.</para>
@ -7120,8 +7120,8 @@
</para>
<para><emphasis remap=bf>To set the communications mode
with</emphasis> <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptcontrol">lptcontrol</ulink>:
with</emphasis> <citerefentry>
<refentrytitle>lptcontrol</refentrytitle></citerefentry>:
<itemizedlist>
<listitem>
@ -7159,8 +7159,8 @@
<para>To test the printer, we will send some text to it. For
printers that can immediately print characters sent to them,
the program <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
the program <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> is perfect: it generates all 96 printable ASCII characters in 96 lines.</para>
<para>For a PostScript (or other language-based) printer, we
will need a more sophisticated test. A small PostScript
@ -7195,8 +7195,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.</para>
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.</para>
</listitem>
<listitem>
@ -7205,8 +7205,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen><userinput>lptest &gt;
/dev/lpt<replaceable>N</replaceable></userinput></screen>
@ -7267,8 +7267,8 @@
<orderedlist>
<listitem>
<para>Become root with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?su">su</ulink>.
<para>Become root with <citerefentry>
<refentrytitle>su</refentrytitle></citerefentry>.
</para>
</listitem>
@ -7295,8 +7295,8 @@
</listitem>
<listitem>
<para>Connect to the printer with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?tip">tip</ulink>. Type:
<para>Connect to the printer with <citerefentry>
<refentrytitle>tip</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>tip printer</screen>
</informalexample> If this step does not work, edit
@ -7312,8 +7312,8 @@
<listitem>
<para>If the printer can print plain text, then
use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. Type:
use <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. Type:
<informalexample>
<screen>~$lptest</screen>
</informalexample>
@ -7375,8 +7375,8 @@
reads this file each time the spooler is used, so updates to the
file take immediate effect.</para>
<para>The format of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?printcap">printcap</ulink> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The format of the <citerefentry>
<refentrytitle>printcap</refentrytitle></citerefentry> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>The simple spooler configuration consists of the following
steps:
@ -7431,8 +7431,9 @@
</listitem>
<listitem>
<para>Test the setup by printing something with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para>Test the setup by printing something with the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command; see <xref linkend="printing-trying" remap="Trying
It Out"> and <xref linkend="printing-troubleshooting"
remap="Troubleshooting">.</para>
@ -7557,8 +7558,8 @@
is customary to put these directories under
<filename>/var/spool</filename>. It is not necessary to
backup the contents of spooling directories, either.
Recreating them is as simple as running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?mkdir">mkdir</ulink>.</para>
Recreating them is as simple as running <citerefentry>
<refentrytitle>mkdir</refentrytitle></citerefentry>.</para>
<para>It is also customary to make the directory with a name
that is identical to the name of the printer, as shown below:
@ -7846,14 +7847,14 @@
Unfortunately, congratulations are not quite yet in order,
since we still have to test the setup and correct any
problems. To test the setup, try printing something. To
print with the LPD system, you use the command <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
print with the LPD system, you use the command <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits a job for printing.</para>
<para>You can combine <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> program, introduced in section <xref linkend="printing-testing"
<para>You can combine <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
with the <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> program, introduced in section <xref linkend="printing-testing"
remap="Checking Printer Communications"> to generate some
test text.</para>
@ -7867,16 +7868,16 @@
</informalexample> where <emphasis
remap=it>printer-name</emphasis> is a the name of a printer
(or an alias) specified in <filename>/etc/printcap</filename>.
To test the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
To test the default printer, type <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
without any <option>-P</option> argument. Again, if you are
testing a printer that expects PostScript, send a PostScript
program in that language instead of using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
program in that language instead of using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para>
<para>For a PostScript printer, you should get the results of
the program. If you are using <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, then your results should look like the following:</para>
the program. If you are using <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, then your results should look like the following:</para>
<para>
<informalexample>
@ -7889,8 +7890,8 @@
<para>To further test the printer, try downloading larger
programs (for language-based printers) or running</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para><citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry> with different arguments. For example, <command>lptest 80 60</command> will produce 60 lines of 80 characters each.</para>
<para>If the printer did not work, see the next section, <xref
linkend="printing-troubleshooting"
@ -7902,8 +7903,8 @@
id="printing-troubleshooting">
<title>Troubleshooting</title>
<para> After performing the simple test with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lptest">lptest</ulink>, you might have gotten one of the following results instead of the correct printout:
<para> After performing the simple test with <citerefentry>
<refentrytitle>lptest</refentrytitle></citerefentry>, you might have gotten one of the following results instead of the correct printout:
<variablelist>
<varlistentry><term>It worked, after awhile; or, it did not
eject a full sheet.</term>
@ -8198,23 +8199,23 @@
<para> This section tells you how to use printers you have setup with
FreeBSD. Here is an overview of the user-level commands:
<variablelist>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry></term>
<listitem>
<para>Print jobs</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry></term>
<listitem>
<para>Check printer queues</para>
</listitem>
</varlistentry>
<varlistentry><term><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink></term>
<varlistentry><term><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry></term>
<listitem>
<para>Remove jobs from a printer's queue</para>
@ -8223,16 +8224,17 @@
</variablelist>
</para>
<para>There is also an administrative command, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>,
<para>There is also an administrative command, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>,
described in the section <xref linkend="printing-lpc"
remap="Administrating the
LPD Spooler">, used to control printers and their queues.</para>
<para>All three of the commands <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>, and
<ulink URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<para>All three of the commands <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>, and
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
accept an option <option>-P</option> <emphasis
remap=it>printer-name</emphasis> to specify on which
printer/queue to operate, as listed in the
@ -8259,8 +8261,8 @@
<screen><userinput>lpr
<replaceable>filename...</replaceable></userinput></screen>
</informalexample> This prints each of the listed files to the
default printer. If you list no files, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> reads
default printer. If you list no files, <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> reads
data to print from standard input. For example, this command
prints some important system files:
<informalexample>
@ -8273,14 +8275,15 @@
current directory to the printer named <hostid>rattan</hostid>:
<informalexample>
<screen>ls -l | lpr -P rattan</screen>
</informalexample> Because no files were listed for the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
</informalexample> Because no files were listed for the
<citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command, <command>lpr</command> read the data to print
from standard input, which was the output of the <command>ls
-l</command> command.</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para>The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
can also accept a wide variety of options to control formatting,
apply file conversions, generate multiple copies, and so forth.
For more information, see the section <xref
@ -8293,8 +8296,8 @@
id="printing-lpq">
<title>Checking Jobs</title>
<para> When you print with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para> When you print with <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
data you wish to print is put together in a package called a
<emphasis>print job</emphasis>, which is sent to the LPD spooling
system. Each printer has a queue of jobs, and your job waits in
@ -8302,8 +8305,9 @@
users. The printer prints those jobs in a first-come, first-served
order.</para>
<para>To display the queue for the default printer, type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>. For a
<para>To display the queue for the default printer, type
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>. For a
specific printer, use the <option>-P</option> option. For
example, the command
<informalexample>
@ -8326,29 +8330,29 @@
details.</para>
<para>Job number nine consists of two files; multiple files given on
the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
line are treated as part of a single job. It is the currently
active job (note the word <literal>active</literal>
under the <quote>Rank</quote> column), which means the printer should be
currently printing that job. The second job consists of data
passed as the standard input to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command. The third job came from user mary; it is a much larger
job. The pathname of the files she's trying to print is too long
to fit, so the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
to fit, so the <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
just shows three dots.</para>
<para>The very first line of the output from <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> is also
<para>The very first line of the output from <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> is also
useful: it tells what the printer is currently doing (or at least
what LPD thinks the printer is doing).</para>
<para>The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> command
<para>The <citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> command
also support a <option>-l</option> option to generate a detailed
long listing. Here is an example of <command>lpq -l</command>:
<informalexample>
@ -8370,15 +8374,16 @@
<title>Removing Jobs</title>
<para> If you change your mind about printing a job, you can remove
the job from the queue with the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
command. Often, you can even use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> to
the job from the queue with the <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command. Often, you can even use <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> to
remove an active job, but some or all of the job might still get
printed.</para>
<para>To remove a job from the default printer, first use <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink> to find
<para>To remove a job from the default printer, first use
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry> to find
the job number. Then type
<informalexample>
<screen><userinput>lprm
@ -8388,8 +8393,8 @@
number 10 from the queue for the printer <hostid>bamboo</hostid>:
<informalexample>
<screen>lprm -P bamboo 10</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
</informalexample> The <citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
command has a few shortcuts:
<variablelist>
<varlistentry><term>lprm -</term>
@ -8415,8 +8420,8 @@
<listitem>
<para>With no job number, user name, or
<option>-</option> appearing on the command line,
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
<citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry> removes the currently active job on the default printer, if it belongs to you. The superuser can remove any active job.</para>
</listitem>
</varlistentry>
@ -8438,8 +8443,8 @@
<para>If you are working in a networked
environment,</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lprm">lprm</ulink>
<para><citerefentry>
<refentrytitle>lprm</refentrytitle></citerefentry>
will let you remove jobs only from the host from which the jobs
were submitted, even if the same printer is available from other
hosts. The following command sequence demonstrates this:
@ -8460,8 +8465,8 @@
id="printing-lpr-options">
<title>Beyond Plain Text: Printing Options</title>
<para> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> command
<para> The <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> command
supports a number of options that control formatting text,
converting graphic and other file formats, producing multiple
copies, handling of the job, and more. This section describes the
@ -8472,12 +8477,12 @@
id="printing-lpr-options-format">
<title>Formatting and Conversion Options</title>
<para> The following <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> The following <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options control formatting of the files in the job. Use these
options if the job does not contain plain text or if you want
plain text formatted through the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
plain text formatted through the <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
utility.</para>
<para>For example, the following command prints a DVI file (from
@ -8565,8 +8570,8 @@
<varlistentry><term>-p</term>
<listitem>
<para>Format plain text with <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<para>Format plain text with <citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
before printing. See <citerefentry><refentrytitle>pr</refentrytitle><manvolnum>1</manvolnum></citerefentry> for more information.</para>
</listitem>
</varlistentry>
@ -8576,8 +8581,8 @@
<listitem>
<para>Use <emphasis remap=it>title</emphasis> on the
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?pr">pr</ulink>
<citerefentry>
<refentrytitle>pr</refentrytitle></citerefentry>
header instead of the file name. This option has effect
only when used with the <option>-p</option>
option.</para>
@ -8601,28 +8606,28 @@
</para>
<para>Here is an example: this command prints a nicely formatted
version of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
version of the <citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page on the default printer:
<informalexample>
<screen>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr
-t</screen>
</informalexample> The <ulink
URL="http://www.freebsd.org/cgi/man.cgi?zcat">zcat</ulink>
</informalexample> The <citerefentry>
<refentrytitle>zcat</refentrytitle></citerefentry>
command uncompresses the source of the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?ls">ls</ulink> manual
page and passes it to the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?troff">troff</ulink>
<para><citerefentry>
<refentrytitle>ls</refentrytitle></citerefentry> manual
page and passes it to the <citerefentry>
<refentrytitle>troff</refentrytitle></citerefentry>
command, which formats that source and makes GNU troff output
and passes it to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>,
and passes it to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>,
which submits the job to the LPD spooler. Because we used the
<option>-t</option> option to</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>, the
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>, the
spooler will convert the GNU troff output into a format the
default printer can understand when it prints the job.</para>
@ -8632,8 +8637,8 @@
id="printing-lpr-options-job-handling">
<title>Job Handling Options</title>
<para> The following options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> tell
<para> The following options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> tell
LPD to handle the job specially:</para>
<para>
@ -8717,8 +8722,8 @@
id="printing-lpr-options-misc">
<title>Header Page Options</title>
<para> These options to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para> These options to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
adjust the text that normally appears on a job's header page.
If header pages are suppressed for the destination printer,
these options have no effect. See section <xref
@ -8772,13 +8777,13 @@
<title>Administrating Printers</title>
<para> As an administrator for your printers, you have had to
install, set up, and test them. Using the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
install, set up, and test them. Using the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command, you can interact with your printers in yet more ways.
With</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>, you
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>, you
can</para>
<para>
@ -8816,14 +8821,14 @@
<para>In general, you have to have root privileges to use the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
command. Ordinary users can use the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> command
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
command. Ordinary users can use the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> command
to get printer status and to restart a hung printer only.</para>
<para>Here is a summary of the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink>
<para>Here is a summary of the <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry>
commands. Most of the commands takes a <emphasis
remap=it>printer-name</emphasis> argument to tell on which
printer to operate. You can use <literal>all</literal>
@ -8879,8 +8884,8 @@
<para>Take a printer down. Equivalent to <command>disable</command> followed by <command>stop</command>. The <emphasis
remap=it>message</emphasis> appears as the printer's
status whenever a user checks the printer's queue with
<ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpq">lpq</ulink>
<citerefentry>
<refentrytitle>lpq</refentrytitle></citerefentry>
or status with <command>lpc
status</command>.</para>
</listitem>
@ -8966,11 +8971,11 @@
</variablelist>
</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> accepts
<para><citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> accepts
the above commands on the command line. If you do not enter any
commands, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpc">lpc</ulink> enters
commands, <citerefentry>
<refentrytitle>lpc</refentrytitle></citerefentry> enters
an interactive mode, where you can enter commands until you type
<command>exit</command>, <command>quit</command>, or end-of-file.</para>
@ -9118,8 +9123,8 @@
what is listed in the <filename>/etc/printcap</filename> file
and what arguments the user specified for the job on the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
<para><citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line. For example, if the user typed <command>lpr
-t</command>, LPD would start the troff filter, listed in the
<emphasis remap=tt>tf</emphasis> capability for the destination
@ -9384,8 +9389,8 @@
text-to-PostScript program you wish. The FreeBSD ports
collection (see <xref linkend="ports" remap="The Ports
Collection">) includes a full featured text-to-PostScript
program called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=a2ps">a2ps</ulink> that you might want to investigate.</para>
program called <citerefentry>
<refentrytitle>a2ps</refentrytitle></citerefentry> that you might want to investigate.</para>
</sect3>
@ -9420,8 +9425,8 @@
for Hewlett Packard DeskJet 500 printers. For other printers,
substitute the <option>-sDEVICE</option> argument to the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=gs">gs</ulink> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<para><citerefentry>
<refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)
<informalexample>
<programlisting>#!/bin/sh # # ifhp - Print
Ghostscript-simulated PostScript on a DeskJet 500 #
@ -9571,8 +9576,8 @@
Invoked by lpd when user runs lpr -d # exec
/usr/local/bin/dvips -f | /usr/local/libexec/lprps
"$@"</programlisting>
</informalexample> This script runs <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
</informalexample> This script runs <citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion"
remap="Accommodating Plain Text Jobs on PostScript
Printers">) with the arguments LPD passed to this script.
<command>lprps</command> will use those arguments
@ -9664,11 +9669,26 @@
<para>Now, for the hard part: making the filter. For that, we
need a DVI-to-LaserJet/PCL conversion program. The FreeBSD
ports collection (see <xref linkend="ports" remap="The
Ports Collection">) has one: <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvi2xx">dvi2xx</ulink> is the name of the package. Installing this package gives us the program we need, <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
Ports Collection">) has one: <citerefentry>
<refentrytitle>dvi2xx</refentrytitle></citerefentry> is the
name of the package. Installing this package gives us the
program we need, <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry>, which converts DVI into LaserJet IIp, LaserJet III, and LaserJet 2000 compatible codes.</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> makes the filter <command>hpdf</command> quite complex since <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> cannot read from standard input. It wants to work with a filename. What is worse, the filename has to end in <filename>.dvi</filename> so using <filename>/dev/fd/0</filename> for standard input is problematic. We can get around that problem by linking (symbolically) a temporary file name (one that ends in <filename>.dvi</filename>) to <filename>/dev/fd/0</filename>, thereby forcing <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj2p">dvilj2p</ulink> to read from standard input.</para>
<para><citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> makes
the filter <command>hpdf</command> quite complex since
<citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> cannot
read from standard input. It wants to work with a filename.
What is worse, the filename has to end in
<filename>.dvi</filename> so using
<filename>/dev/fd/0</filename> for standard input is
problematic. We can get around that problem by linking
(symbolically) a temporary file name (one that ends in
<filename>.dvi</filename>) to <filename>/dev/fd/0</filename>,
thereby forcing <citerefentry>
<refentrytitle>dvilj2p</refentrytitle></citerefentry> to read from standard input.</para>
<para>The only other fly in the ointment is the fact that we
cannot use <filename>/tmp</filename> for the temporary link.
@ -9724,8 +9744,8 @@
<para> All these conversion filters accomplish a lot for your
printing environment, but at the cost forcing the user to
specify (on the <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
specify (on the <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
command line) which one to use. If your users are not
particularly computer literate, having to specify a filter
option will become annoying. What is worse, though, is that
@ -9743,8 +9763,8 @@
you can still provide conversion filters just for them.</para>
<para>The FreeBSD ports collection has a text filter that
performs automatic conversion called <ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=apsfilter">apsfilter</ulink>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
performs automatic conversion called <citerefentry>
<refentrytitle>apsfilter</refentrytitle></citerefentry>. It can detect plain text, PostScript, and DVI files, run the proper conversions, and print.</para>
</sect4>
</sect3>
@ -9939,8 +9959,8 @@
they can suppress header pages by submitting the job with
<command>lpr -h</command>; see <xref
linkend="printing-lpr-options-misc" remap="Header Page
Options"> for more <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
Options"> for more <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
options.</para>
<note>
@ -10439,8 +10459,8 @@
<para>If you feel multiple copies cause unnecessary wear and tear
on your printers, you can disable the <option>-#</option> option
to <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink> by
to <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry> by
adding the <emphasis remap=tt>sc</emphasis> capability to the
<filename>/etc/printcap</filename> file. When users submit jobs
with the <option>-#</option> option, they will see
@ -10491,8 +10511,8 @@
:lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc:</programlisting>
</informalexample> By using the <emphasis remap=tt>sc</emphasis>
capability, we prevent the use of <command>lpr -#</command>, but
that still does not prevent users from running <ulink
URL="http://www.freebsd.org/cgi/man.cgi?lpr">lpr</ulink>
that still does not prevent users from running <citerefentry>
<refentrytitle>lpr</refentrytitle></citerefentry>
multiple times, or from submitting the same file multiple times
in one job like this:
<informalexample>
@ -10633,7 +10653,11 @@
<para>The format of these files is simple: one host name
per line. Note that the file
<filename>/etc/hosts.equiv</filename> is also used by
the <citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <ulink URL="http://www.freebsd.org/cgi/man.cgi?rsh">rsh</ulink> and <ulink URL="http://www.freebsd.org/cgi/man.cgi?rcp">rcp</ulink>, so be careful.</para>
the
<citerefentry><refentrytitle>ruserok</refentrytitle><manvolnum>3</manvolnum></citerefentry> protocol, and affects programs like <citerefentry>
<refentrytitle>rsh</refentrytitle></citerefentry> and
<citerefentry>
<refentrytitle>rcp</refentrytitle></citerefentry>, so be careful.</para>
<para>For example, here is the
<filename>/etc/hosts.lpd</filename> file on the host
@ -10802,8 +10826,8 @@
<xref linkend="printing-advanced-lpf" remap="lpf: a Text
Filter">, and</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>, a
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>, a
program to gather and total entries from printer accounting
files.</para>
@ -10839,11 +10863,11 @@
<para>When you are ready to charge users for printouts, run
the</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para><citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
program. Just change to the spooling directory for the printer
you want to collect on and type <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>. You
you want to collect on and type <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>. You
will get a dollar-centric summary like the following:
<informalexample>
<programlisting> Login pages/feet runs
@ -10854,8 +10878,8 @@
rose:mary 87.00 32 $ 1.74 rose:root
26.00 12 $ 0.52 total 337.00 154
$ 6.74</programlisting>
</informalexample> These are the arguments <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
</informalexample> These are the arguments <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
expects:
<variablelist>
<varlistentry><term><option>-P<replaceable>printer</replaceable></option></term>
@ -10926,8 +10950,8 @@
</variablelist>
</para>
<para>In the default summary that <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
<para>In the default summary that <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
produces, you see the number of pages printed by each user from
various hosts. If, at your site, host does not matter (because
users can use any host), run <command>pac -m</command>, to
@ -10939,14 +10963,16 @@
$ 2.36 root 26.00 12 $ 0.52
zhang 9.00 1 $ 0.18 total
337.00 154 $ 6.74</programlisting>
</informalexample> To compute the dollar amount due, <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> uses
</informalexample> To compute the dollar amount due,
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> uses
the <emphasis remap=tt>pc</emphasis> capability in the
<filename>/etc/printcap</filename> file (default of 200, or 2
cents per page). Specify, in hundredths of cents, the price per
page or per foot you want to charge for printouts in this
capability. You can override this value when you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink> with
capability. You can override this value when you run
<citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry> with
the <option>-p</option> option. The units for the
<option>-p</option> option are in dollars, though, not
hundredths of cents. For example,
@ -10960,8 +10986,8 @@
summary information in a summary accounting file, which is named
the same as the printer's accounting file, but with
<symbol>_sum</symbol> appended to the name. It then truncates
the accounting file. When you run <ulink
URL="http://www.freebsd.org/cgi/man.cgi?pac">pac</ulink>
the accounting file. When you run <citerefentry>
<refentrytitle>pac</refentrytitle></citerefentry>
again, it rereads the summary file to get starting totals, then
adds information from the regular accounting file.</para>
@ -10992,8 +11018,10 @@
<para>Well, for DVI-to-LaserJet or DVI-to-PostScript conversion,
you can have your filter parse the diagnostic output of</para>
<para><ulink
URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvilj">dvilj</ulink> or <ulink URL="http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+Ports&amp;query=dvips">dvips</ulink> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para><citerefentry>
<refentrytitle>dvilj</refentrytitle></citerefentry> or
<citerefentry>
<refentrytitle>dvips</refentrytitle></citerefentry> and look to see how many pages were converted. You might be able to do similar things with other file formats and conversion programs.</para>
<para>But these methods suffer from the fact that the printer may
not actually print all those pages. For example, it could jam,