500 lines
8.3 KiB
HTML
500 lines
8.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Getting Started</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Debian and Windows Shared Printing mini-HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Introduction"
|
|
HREF="introduction.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Printing To Windows PCs"
|
|
HREF="printing_to_windows.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"
|
|
>Debian and Windows Shared Printing mini-HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="introduction.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="printing_to_windows.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="getting_started"
|
|
></A
|
|
>2. Getting Started</H1
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="linuxprintingcomponents"
|
|
></A
|
|
>2.1. Linux Printing Components</H2
|
|
><P
|
|
> The main components we will be using include:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> CUPS
|
|
</P
|
|
><P
|
|
> The Common UNIX Printing System
|
|
(<A
|
|
HREF="http://www.cups.org"
|
|
TARGET="_top"
|
|
>http://www.cups.org</A
|
|
>)
|
|
is a print spooler and a set
|
|
of support programs for using and administering printers.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Samba
|
|
</P
|
|
><P
|
|
> Samba
|
|
(<A
|
|
HREF="http://www.samba.org"
|
|
TARGET="_top"
|
|
>http://www.samba.org</A
|
|
>)
|
|
is software that allows non-Windows computers to act
|
|
like Windows computers on a network by implementing Windows file
|
|
and printer sharing protocols.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Printer Drivers
|
|
</P
|
|
><P
|
|
> LinuxPrinting.org
|
|
(<A
|
|
HREF="http://www.linuxprinting.org"
|
|
TARGET="_top"
|
|
>http://www.linuxprinting.org</A
|
|
>)
|
|
offers the largest number of printer drivers
|
|
and maintains a database of printers supported under Linux. You must
|
|
download a printer driver for each model of printer you want to use
|
|
in Linux. A printer driver consists of a PPD file and a filter
|
|
program, or only a PPD file for PostScript printers.
|
|
</P
|
|
></LI
|
|
></UL
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="packages"
|
|
></A
|
|
>2.2. Required Packages</H2
|
|
><P
|
|
> All of the required programs and libraries are part of the standard
|
|
Debian archive. You may download and install these packages with the
|
|
usual Debian packaging tools. The following is a list of packages
|
|
you need:
|
|
</P
|
|
><P
|
|
></P
|
|
><DIV
|
|
CLASS="variablelist"
|
|
><DL
|
|
><DT
|
|
>cupsys</DT
|
|
><DD
|
|
><P
|
|
>CUPS server</P
|
|
></DD
|
|
><DT
|
|
>cupsys-bsd</DT
|
|
><DD
|
|
><P
|
|
>CUPS BSD commands</P
|
|
></DD
|
|
><DT
|
|
>cupsys-client</DT
|
|
><DD
|
|
><P
|
|
>CUPS client programs</P
|
|
></DD
|
|
><DT
|
|
>foomatic-bin</DT
|
|
><DD
|
|
><P
|
|
>LinuxPrinting.org printer support programs</P
|
|
></DD
|
|
><DT
|
|
>samba</DT
|
|
><DD
|
|
><P
|
|
>Samba SMB/CIFS server for UNIX</P
|
|
></DD
|
|
><DT
|
|
>smbclient</DT
|
|
><DD
|
|
><P
|
|
>Samba SMB/CIFS client for UNIX</P
|
|
></DD
|
|
><DT
|
|
>gs-esp</DT
|
|
><DD
|
|
><P
|
|
>ESP Ghostscript
|
|
(<A
|
|
HREF="http://www.cups.org/ghostscript.php"
|
|
TARGET="_top"
|
|
> http://www.cups.org/ghostscript.php</A
|
|
>)</P
|
|
><P
|
|
>Not available as a Debian GNU/Linux 3.0 (a.k.a. woody) package,
|
|
use <SPAN
|
|
CLASS="QUOTE"
|
|
>"gs"</SPAN
|
|
> instead.</P
|
|
></DD
|
|
><DT
|
|
>a2ps</DT
|
|
><DD
|
|
><P
|
|
>GNU A2PS
|
|
(<A
|
|
HREF="http://www.gnu.org/software/a2ps/"
|
|
TARGET="_top"
|
|
> http://www.gnu.org/software/a2ps/</A
|
|
>)</P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
><P
|
|
> The following commands will install these packages.
|
|
You will have to become root or use <B
|
|
CLASS="command"
|
|
>sudo</B
|
|
> to execute these commands:
|
|
</P
|
|
><P
|
|
> <TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>apt-get update
|
|
apt-get install cupsys cupsys-bsd cupsys-client foomatic-bin samba smbclient gs-esp a2ps
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
><P
|
|
> Additional packages may be required for specific printers. For example,
|
|
the <EM
|
|
>hpijs</EM
|
|
> package must be installed for many HP InkJet,
|
|
DeskJet and LaserJet printers to function properly. The PPD files for these
|
|
printers are identified by the string <TT
|
|
CLASS="filename"
|
|
>hpijs</TT
|
|
> in their
|
|
filenames.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="basicprconfig"
|
|
></A
|
|
>2.3. CUPS Local Printer Configuration</H2
|
|
><P
|
|
> The <B
|
|
CLASS="command"
|
|
>lpadmin</B
|
|
> command is used to configure printers. The
|
|
following is an example of setting up a laser printer with CUPS.
|
|
You will have to become root or use <B
|
|
CLASS="command"
|
|
>sudo</B
|
|
> to execute these commands:
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>/usr/sbin/lpadmin -p Laser -v parallel:/dev/lp0 -P /root/laser.ppd
|
|
/usr/bin/enable Laser
|
|
/usr/sbin/accept Laser
|
|
/usr/sbin/lpadmin -d Laser
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> Please note that bash has a builtin command called
|
|
<B
|
|
CLASS="command"
|
|
>enable</B
|
|
>, so bash users must use the full path
|
|
(<B
|
|
CLASS="command"
|
|
>/usr/bin/enable</B
|
|
>) to enable printers.
|
|
</P
|
|
><P
|
|
> The first command creates a new printer called <SPAN
|
|
CLASS="QUOTE"
|
|
>"Laser"</SPAN
|
|
>
|
|
that is connected to the first parallel port and is using the PPD
|
|
file <TT
|
|
CLASS="filename"
|
|
>/root/laser.ppd</TT
|
|
>.
|
|
<SPAN
|
|
CLASS="QUOTE"
|
|
>"Laser"</SPAN
|
|
> is then enabled and told to accept jobs with
|
|
the <B
|
|
CLASS="command"
|
|
>enable</B
|
|
> and <B
|
|
CLASS="command"
|
|
>accept</B
|
|
> commands.
|
|
The last command sets <SPAN
|
|
CLASS="QUOTE"
|
|
>"Laser"</SPAN
|
|
> as the default printer.
|
|
</P
|
|
><P
|
|
> If your printer is connected to a USB port or if you do not know the
|
|
correct device-uri for your printer try running
|
|
<B
|
|
CLASS="command"
|
|
>/usr/sbin/lpinfo -v</B
|
|
> to get a list of available
|
|
printer devices.
|
|
</P
|
|
><P
|
|
> Make sure your printer's page size and other options are set correctly
|
|
by running <B
|
|
CLASS="command"
|
|
>/usr/bin/lpoptions -l</B
|
|
>.
|
|
More detailed information about printer configuration
|
|
is available in the CUPS documentation.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="basics"
|
|
></A
|
|
>2.4. Linux Printing Basics</H2
|
|
><DIV
|
|
CLASS="figure"
|
|
><A
|
|
NAME="printlocal"
|
|
></A
|
|
><P
|
|
><B
|
|
>Figure 1. Printing Locally</B
|
|
></P
|
|
><P
|
|
><IMG
|
|
SRC="printing_basics.png"></P
|
|
></DIV
|
|
><P
|
|
> Documents are spooled by using either <B
|
|
CLASS="command"
|
|
>lpr</B
|
|
> or
|
|
<B
|
|
CLASS="command"
|
|
>lp</B
|
|
> followed
|
|
by the file name. You may view the printer queue and check the printer
|
|
status with the command <B
|
|
CLASS="command"
|
|
>lpstat -o</B
|
|
> or
|
|
<B
|
|
CLASS="command"
|
|
>lpstat -p</B
|
|
>. To cancel a print job use either
|
|
<B
|
|
CLASS="command"
|
|
>cancel</B
|
|
> or <B
|
|
CLASS="command"
|
|
>lprm</B
|
|
> followed by the job id.
|
|
</P
|
|
><P
|
|
> The CUPS spooler daemon is called <EM
|
|
>cupsd</EM
|
|
>.
|
|
It converts documents
|
|
to PostScript, then converts them to a format native to the printer
|
|
<A
|
|
HREF="getting_started.html#printlocal"
|
|
>Figure 1</A
|
|
>. Printers that do not understand PostScript
|
|
use a rasterized, or bitmap, format for documents. Rasterized formats
|
|
can be much larger than the original PostScript, and will take longer
|
|
to send to the printer.
|
|
</P
|
|
><P
|
|
> Filters are programs used to convert documents from one format to
|
|
another. The CUPS spooler will do its best to find a suitable filter
|
|
for the documents you send. If no filter suitable for converting your
|
|
document is installed you will receive an error similar to <TT
|
|
CLASS="computeroutput"
|
|
>lpr:
|
|
unable to print file: client-error-document-format-not-supported.</TT
|
|
>
|
|
</P
|
|
><P
|
|
> Many applications do not include filters for their documents formats.
|
|
Documents created with these applications can only be printed from
|
|
within the application itself, unless the document is exported to
|
|
PostScript or another standard format.
|
|
</P
|
|
></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="introduction.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="printing_to_windows.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Introduction</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Printing To Windows PCs</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |