LDP/LDP/howto/docbook/Print2Win.xml

211 lines
6.9 KiB
XML

<?xml version="1.0" standalone="no"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://docbook.org/xml/4.1.2/docbookx.dtd" []>
<article id="Print2Win">
<articleinfo>
<title>The Linux Print2Win mini-HOWTO</title>
<authorgroup>
<author>
<firstname>Marcelo</firstname>
<othername role="middle">Pereira</othername>
<surname>da Silva</surname>
<affiliation>
<address><email>marcelo@pereira.com</email></address>
</affiliation>
</author>
</authorgroup>
<releaseinfo>v1.1</releaseinfo>
<pubdate>Jan 2002</pubdate>
<abstract>
<para>
This howto contains the general configuration to get Linux printing to a
Windows print share.
</para>
</abstract>
<revhistory id="revhistory">
<revision>
<revnumber>1.1</revnumber>
<date>2002-07-19</date>
<authorinitials>ms</authorinitials>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>2002-01-01</date>
<authorinitials>ms</authorinitials>
</revision>
</revhistory>
</articleinfo>
<section>
<title>Introduction</title>
<para>
As we want the print service running, we'll set up all the
environment step by step, to avoid mistakes or bad configurations.
</para>
<para>
First, set up the server; when you have the server running, configure
the clients.
</para>
</section>
<section>
<title>Server (Windows)</title>
<para>
There is no special rules when configuring the server. Just install the
printer driver in the Windows server, test it to verify that the printer
is running properly, and share the printer.
</para>
</section>
<section>
<title>Client (Linux)</title>
<para>
The client configuration is similar to Linux to Linux printing.
</para>
<section>
<title>Standard lpr</title>
<para>
The simplest way to do it is to add an entry to
<filename>/etc/printcap</filename>. As a quick example, the entry
for a generic matrix printer would be:
<screen># EPSON LX300
epson:\
:sd=/var/spool/lpd/epson:\
:mx#0:\
:sh:\
:if=/var/spool/lpd/epson/filter:\
:lp=/dev/null:</screen>
</para>
<note>
<para>
Make sure you are using the correct filter, or the right generic
one.
</para>
</note>
<para>
Be sure you have created the directory
<filename>/var/spool/lpd/epson</filename>, and the users you wish
to use the printer have the right access to this.
</para>
<para>
For example, assume the Windows print server is named <systemitem
class="systemname">meriadoc</systemitem>, with an <acronym
role="protocol">IP</acronym> address of
<literal>192.168.1.49</literal>, and the printer is shared from
Windows as <systemitem class="systemname">epsonLX</systemitem>.
</para>
<para>
So, you have to configure
<filename>/var/spool/lpd/epson/.config</filename> like this:
<screen>share='\\meriadoc\epsonLX'
hostip=192.168.1.49</screen>
</para>
<para>
Where:
<itemizedlist>
<listitem>
<para><varname>share</varname>='\\<replaceable>windows-print-server-name</replaceable>\<replaceable>print-share-name</replaceable>'</para>
</listitem>
<listitem>
<para><varname>hostip</varname>=<replaceable>windows-print-server-IP</replaceable></para>
</listitem>
</itemizedlist>
</para>
<para>
Once your <filename>/etc/printcap</filename> is configured, you
have to enable the print share:
<screen><prompt>[localhost]$</prompt> <userinput>lpc up epson</userinput>
<prompt>[localhost]$</prompt> <userinput>lpc enable epson</userinput></screen>
</para>
<para>
If everything is ok, you can send jobs to the queue:
<screen><prompt>[localhost]$</prompt> <userinput>lpr -Pepson <replaceable>file</replaceable></userinput></screen>
</para>
</section>
</section>
<section>
<title><filename>/etc/printcap</filename> Tips</title>
<para>
I have used the entry below in the first example, but this is not a
particularly good idea:
<screen>...
:lp=/dev/null:\</screen>
</para>
<para>
Because lpr does an <quote>exclusive</quote> open on the file you specify as lp=.
It does this in order to prevent multiple processes from trying to
print to the same printer at the same time.
</para>
<para>
The side effect of this is that in your case, <literal>eng</literal>
and <literal>colour</literal> can't print at the same time, (usually more
or less transparent since they probably print quickly and since they queue
you probably don't notice) but any other process that tries to write to
<filename>/dev/null</filename> will break!
</para>
<para>
On a single user system, probably not a big problem. I have a system with
over 50 printers. It would be a problem there.
</para>
<para>
The solution is to create a dummy printer for each. Eg:
<userinput>touch /dev/eng</userinput>.
</para>
<para>
<screen><prompt>[localhost]$</prompt> <userinput>touch /dev/eng</userinput>
<prompt>[localhost]$</prompt> <userinput>touch /dev/colour</userinput></screen>
</para>
</section>
<!-- The License section could move to a legalnotice in the articleinfo -->
<!-- block. -->
<section>
<title>License</title>
<para>
This document, Print2Win-HOWTO,
is copyrighted (c) 2001-2002 by Marcelo Pereira da Silva.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation; with no Invariant Sections, with no Front-Cover Texts,
and with no Back-Cover Texts. A copy of the license
is available at <ulink url="http://www.gnu.org/copyleft/fdl.html"/>.
</para>
</section>
<section>
<title>Credits</title>
<para>
Thanks to all those who sent opinions about this document, to
everybody who told me some printing tips, to Rick Bressler, and a
special thanks to Harish Pillay, who wrote the first version of this
document.
</para>
<!-- The original text read as follows: -->
<!-- "to Harish Pillay, whose I don't know,..." -->
<!-- I didn't know whether the word "email" was missing, or "whose" should -->
<!-- be "who". To simplify life, I just dropped the "whose I don't know" -->
<!-- clause entirely. John R. Daily (john@geekhavoc.com), 2002-07-09 -->
</section>
</article>