old-www/HOWTO/Printing-HOWTO/how.html

548 lines
11 KiB
HTML

<HTML
><HEAD
><TITLE
>How to print</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Printing HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Quick Start"
HREF="quickstart.html"><LINK
REL="NEXT"
TITLE="Kernel printer devices"
HREF="kernel.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Printing HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="quickstart.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="kernel.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="how"
></A
>3. How to print</H1
><P
>You actually use a different command to print depending on which
spooling software you use.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="with-lpd-and-lpr"
></A
>3.1. With BSD LPD and the lpr command</H2
><P
>If you've already got lpd setup to print to your printer, or your
system administrator already did so, or your vendor did so for
you, then all you need to do is learn how to use the lpr command.
The <A
HREF="http://www.tldp.org/HOWTO/Printing-Usage-HOWTO.html"
TARGET="_top"
>Printing Usage HOWTO</A
> covers this, and a few other queue
manipulation commands you should probably know. Or just read the
lpr(1) man page.</P
><P
>In a nutshell, you specify the queue name with <TT
CLASS="literal"
>-P</TT
>, and specify a filename to print a file,
or nothing to print from stdin. Driver options are traditionally
not controllable from lpr, but various systems accept certain
options with <TT
CLASS="literal"
>-o</TT
>, <TT
CLASS="literal"
>-Z</TT
>, or <TT
CLASS="literal"
>-J</TT
>.</P
><DIV
CLASS="example"
><A
NAME="AEN117"
></A
><P
><B
>Example 1. lpr</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>lpr /etc/hosts
lpr -J "my hosts file" /etc/hosts
lpr -P mylaserjet /etc/services</PRE
></FONT
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN120"
></A
>3.2. With System V LPD and the lp command</H2
><P
>There are two sets of commands that you may encounter if you have to deal with several brands of Unix. The BSD based LPD print system (*BSD, Linux) uses lpr (print),lpq (display queue),lprm (remove jobs). System V based systems on the other hand use lp (print), lpstat (display queue), cancel (remove jobs). Solaris, SCO and others are System V Unix systems.</P
><P
>On SYSV systems, you can of course consult the man page of the lp command. To specify a queue you use the -d option and a filename to print a file, or nothing to print from stdin.</P
><DIV
CLASS="example"
><A
NAME="AEN127"
></A
><P
><B
>Example 2. lp</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>lp /etc/hosts
lp -d mylaserjet /etc/services</PRE
></FONT
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN130"
></A
>3.3. With CUPS</H2
><P
>CUPS provides both the System V and Berkeley command-line interfaces. This means that you can use either lpr or lp to print. This is really nice if you have a bunch of scripts that already use eg. lp or you have prior experience with either a System V or a BSD flavor.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="how-with-gui-tools"
></A
>3.4. GUI Printing Tools</H2
><P
>Most spooling systems alone offer only a rather basic command-line
interface. Rather than use <B
CLASS="command"
>lpr</B
> directly, you
may wish to obtain and use a front-end interface. These generally
let you fiddle with various printing options (the printer, paper
types, collation, n-up, etc) in an easy-to-use graphical way.
Some may have other features, as well.</P
><DIV
CLASS="simplesect"
><H3
CLASS="simplesect"
><A
NAME="kdeprint-sect"
></A
>3.4.1. KDEPrint</H3
><P
>KDEPrint allows users access to printing subsystems (CUPS, LPD, RLPR, LPRng etc.) through a KDE graphical user interface. With KDEPrint, you can easily print, administer jobs and printers and the printing daemon. KDEPrint is a replacement for the old QtCUPS and KUPS. It is easy to use for both developers and users. KDEPrint is already a part of KDE since 2.2.0 and has several nice features.</P
><P
>kprinter is the print dialog of KDEPrint which allows you to select the destination printer and change printer options. Among the destination printers, there are a few virtual printers allowing you to print to email, fax or pdf.
<DIV
CLASS="figure"
><A
NAME="AEN146"
></A
><P
><B
>Figure 1. kprinter</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-kdeprint-kprinter.png"></P
></DIV
></DIV
></P
><P
>You can use KDEPrint's <B
CLASS="command"
>kprinter</B
> in any application that lets you configure your print command. Examples of these are Mozilla and OpenOffice.
<DIV
CLASS="figure"
><A
NAME="AEN153"
></A
><P
><B
>Figure 2. Using kprinter with Mozilla</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-kdeprint-mozilla.png"></P
></DIV
></DIV
>
</P
><P
>KDEPrint also features a Print Preview. that you can select from the Print Dialog. This is accomplished by passing the print file through the filters which make it suitable for displaying on screen using KGhostView or an external application like gv.</P
><P
>The KDEPrint Job Viewer <B
CLASS="command"
>KJobViewer</B
> allows you to view, move and cancel print jobs.
<DIV
CLASS="figure"
><A
NAME="AEN161"
></A
><P
><B
>Figure 3. KJobViewer</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-kdeprint-kjobviewer.png"></P
></DIV
></DIV
></P
><P
>You can find more information about KDEPrint at <A
HREF="http://printing.kde.org/"
TARGET="_top"
>http://printing.kde.org/</A
>.</P
></DIV
><DIV
CLASS="simplesect"
><H3
CLASS="simplesect"
><A
NAME="xpp-sect"
></A
>3.4.2. XPP</H3
><P
>Another good choice for CUPS is the program <B
CLASS="command"
><A
HREF="http://cups.sourceforge.net/xpp/"
TARGET="_top"
>XPP</A
></B
>
(see <A
HREF="how.html#snapshot-xpp-main"
>Figure 4</A
>). XPP is built from the
FLTK library and is therefore desktop agnostic.</P
><P
>To print with XPP, simply run the xpp program, and specify a file
(or nothing, if you're using xpp in place of lpr to print from
stdin). Then select a printer from the list of configured
printers, and select any options you'd like to apply from the
various tabbed panels. See <A
HREF="how.html#snapshot-xpp-options"
>Figure 5</A
>
for an example options panel highlighting the standard CUPS
options.</P
><P
>&#13;
When used with Foomatic driver interface system, XPP will
also let you control numeric parameters not normally supported by
CUPS. This typically includes such things as extended color
tuning, cartridge alignment, and so forth. See <A
HREF="how.html#snapshot-xpp-foomaticoptions"
>Figure 6</A
> for an example of this.</P
><P
>You can save your selected printer and all the options with the
`Save Settings' button.</P
><DIV
CLASS="figure"
><A
NAME="snapshot-xpp-main"
></A
><P
><B
>Figure 4. XPP Main Window</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-xpp-main.png"></P
></DIV
></DIV
><DIV
CLASS="figure"
><A
NAME="snapshot-xpp-options"
></A
><P
><B
>Figure 5. CUPS/XPP Options Window</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-xpp-options.png"></P
></DIV
></DIV
><DIV
CLASS="figure"
><A
NAME="snapshot-xpp-foomaticoptions"
></A
><P
><B
>Figure 6. CUPS/XPP Foomatic Options Window</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-xpp-foomaticoptions.png"></P
></DIV
></DIV
></DIV
><DIV
CLASS="simplesect"
><H3
CLASS="simplesect"
><A
NAME="gpr-intro"
></A
>3.4.3. GPR</H3
><P
><A
HREF="http://www.compumetric.com/linux.html"
TARGET="_top"
>GPR</A
>,
by Thomas Hubbell, uses code from CUPS to filter Postscript jobs
and offer easy user control over job options. Some options (like
n-way printing, page selection, etc) are implemented directly by
GPR, while most others are implemented by the printer or by the
spooler's filter system.</P
><P
>GPR works with LPD or LPRng; or can be compiled specifically for
use with GNUlpr. When compiled normally, it
uses VA's libppd directly to produce printer-specific
PostScript which it will then submit to the lpr command. When
compiled for GNUlpr, it will submit your unmodified Postscript job
to the lpr command, along with the set of job options
you specify. This is arguably the better route, since it allows
the Postscript to be redirected to a different printer by the
spooler when appropriate; unfortunately it requires GNUlpr, which is not in wide circulation (although it is of
course trivial to install).</P
><P
>To use GPR, first select a printer (by LPD queue name) and check
that GPR has loaded the proper PPD file. If it hasn't, you'll
need to specify the PPD filename, and specify your printer's
options in the Printer Configuration dialog (you get this dialog
by pressing the Printer Configuration button; it contains
assorted printer setup options defined by the PPD).</P
><P
>Once you've configured your printer in GPR, you can print jobs by
specifying the filename and selecting the proper options from the
`Common' and `Advanced' tabbed panels. The `Common' options are
implemented directly by GPR for all printers, while the
`Advanced' options are defined by the PPD file for your printer.
You can see these option panels in <A
HREF="how.html#snapshot-gpr-common"
>Figure 8</A
> and <A
HREF="how.html#snapshot-gpr-printer"
>Figure 9</A
>.</P
><DIV
CLASS="figure"
><A
NAME="snapshot-gpr-main"
></A
><P
><B
>Figure 7. GPR Main Options</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-gpr-main.png"></P
></DIV
></DIV
><DIV
CLASS="figure"
><A
NAME="snapshot-gpr-common"
></A
><P
><B
>Figure 8. GPR Common Options</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-gpr-common.png"></P
></DIV
></DIV
><DIV
CLASS="figure"
><A
NAME="snapshot-gpr-printer"
></A
><P
><B
>Figure 9. GPR Printer Options</B
></P
><DIV
CLASS="mediaobject"
><P
><IMG
SRC="images/snapshot-gpr-printer.png"></P
></DIV
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="quickstart.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="kernel.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Quick Start</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Kernel printer devices</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>