• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/LPRng/DOCS/LPRng-Reference-Multipart/
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<html>
4  <head>
5    <meta name="generator" content="HTML Tidy, see www.w3.org">
6    <title>Printing to a SMB (MicroSoft) Printer</title>
7    <meta name="GENERATOR" content=
8    "Modular DocBook HTML Stylesheet Version 1.7">
9    <link rel="HOME" title=" LPRng Reference Manual" href=
10    "index.htm">
11    <link rel="UP" title="Printer Communication and Protocols "
12    href="printercomm.htm">
13    <link rel="PREVIOUS" title=
14    "Problems With Network Print Servers" href="x5193.htm">
15    <link rel="NEXT" title="Printing to AppleTalk Printers" href=
16    "x5238.htm">
17  </head>
18
19  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
20  "#0000FF" vlink="#840084" alink="#0000FF">
21    <div class="NAVHEADER">
22      <table summary="Header navigation table" width="100%" border=
23      "0" cellpadding="0" cellspacing="0">
24        <tr>
25          <th colspan="3" align="center">LPRng Reference Manual: 5
26          Sep 2003 (For LPRng-3.8.22)</th>
27        </tr>
28
29        <tr>
30          <td width="10%" align="left" valign="bottom"><a href=
31          "x5193.htm" accesskey="P">Prev</a></td>
32
33          <td width="80%" align="center" valign="bottom">Chapter
34          11. Printer Communication and Protocols</td>
35
36          <td width="10%" align="right" valign="bottom"><a href=
37          "x5238.htm" accesskey="N">Next</a></td>
38        </tr>
39      </table>
40      <hr align="LEFT" width="100%">
41    </div>
42
43    <div class="SECT1">
44      <h1 class="SECT1"><a name="AEN5224">11.9. Printing to a SMB
45      (MicroSoft) Printer</a></h1>
46
47      <p>Microsoft use the SMB (Simple Message Block) protocol to
48      transfer files and print jobs to hosts and printers. SMB can
49      be used over TCP/IP, NetBEUI, IPX, and other lower level
50      network protocols.</p>
51
52      <p>Unfortunately, most printers do not provide detailed
53      status or error reports when using the SMB protocol. There
54      are a very large number of printers that have deficient SMB
55      support that causes problems when used in a high traffic or
56      high throughput environment.</p>
57
58      <p>It is highly recommended that this protocol not be used
59      unless there is no alternative.</p>
60
61      <p>If you have a printer or a remote print spooler that
62      supports SMB You can use the <a href="smb.htm">SAMBA</a> <b
63      class="APPLICATION">smbclient</b> program to send a print job
64      to an SMB client. The following is a sample Shell Script
65      script which you can use:</p>
66
67      <div class="INFORMALEXAMPLE">
68        <a name="AEN5232"></a>
69<pre class="SCREEN">
70    #!/bin/sh -x
71    # This script is an input filter for printing on a unix machine. It
72    # uses the smbclient program to print the file to the specified smb-based
73    # server and service.
74    # The 'smb' printcap entry below shows how to configure LPRng
75    # for printing
76    #
77    # smb:
78    #  :lp=|/usr/local/samba/smbprint
79    #  :sd=/var/spool/smb:
80    #  :filter= ... filter ...
81    #
82    # The /var/spool/smb/.config file should contain:
83    #   server="PC_SERVER"
84    #   service="PR_SHARENAME"
85    #   password="PASSWORD"
86    #
87    # Set PC_SERVER to the server, PR_SHARENAME to the printer,
88    # and PASSWORD to the password for this service.
89    #
90    # E.g.
91    #   server=PAULS_PC
92    #   service=CJET_371
93    #   password=""
94    #
95    #
96    config_file=.config
97    if [ -f $config_file ] ; then
98        eval `/bin/cat $config_file`
99    fi
100    #
101    # NOTE You may wish to add the line `echo translate'
102    # if you want automatic
103    # CR/LF translation when printing.
104    (
105    #   echo translate
106        echo "print -"
107        /bin/cat
108    ) | /usr/local/bin/smbclient "\\\\$server\\$service" \
109       "$password" -U "$server" -N -P 1&gt;&amp;2
110</pre>
111      </div>
112      <br>
113      <br>
114
115      <p>If the above script was in <tt class=
116      "FILENAME">/usr/local/libexec/filters/smbprint</tt>, the
117      printcap entry for this printer would be:</p>
118
119      <div class="INFORMALEXAMPLE">
120        <a name="AEN5236"></a>
121<pre class="SCREEN">
122    pauls_pc:
123      :sd=/var/spool/lpd/%P
124      # we filter the output
125      :lp=|/usr/local/libexec/filters/smbprint
126      # you can add filters if you want to do specific actions
127      :ifhp=model=hp4
128      :filter=/usr/local/libexec/filters/ifhp
129</pre>
130      </div>
131      <br>
132      <br>
133    </div>
134
135    <div class="NAVFOOTER">
136      <hr align="LEFT" width="100%">
137
138      <table summary="Footer navigation table" width="100%" border=
139      "0" cellpadding="0" cellspacing="0">
140        <tr>
141          <td width="33%" align="left" valign="top"><a href=
142          "x5193.htm" accesskey="P">Prev</a></td>
143
144          <td width="34%" align="center" valign="top"><a href=
145          "index.htm" accesskey="H">Home</a></td>
146
147          <td width="33%" align="right" valign="top"><a href=
148          "x5238.htm" accesskey="N">Next</a></td>
149        </tr>
150
151        <tr>
152          <td width="33%" align="left" valign="top">Problems With
153          Network Print Servers</td>
154
155          <td width="34%" align="center" valign="top"><a href=
156          "printercomm.htm" accesskey="U">Up</a></td>
157
158          <td width="33%" align="right" valign="top">Printing to
159          AppleTalk Printers</td>
160        </tr>
161      </table>
162    </div>
163  </body>
164</html>
165
166