1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >Printing Support</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"><LINK
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
13 TITLE="Optional configuration"
14 HREF="optional.html"><LINK
16 TITLE="Hosting a Microsoft Distributed File System tree on Samba"
17 HREF="msdfs.html"><LINK
19 TITLE="Unified Logons between Windows NT and UNIX using Winbind"
20 HREF="winbind.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SAMBA Project Documentation</TH
77 >Chapter 13. Printing Support</H1
85 >13.1. Introduction</H1
87 >Beginning with the 2.2.0 release, Samba supports
88 the native Windows NT printing mechanisms implemented via
89 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
90 Samba only supported LanMan printing calls.</P
92 >The additional functionality provided by the new
93 SPOOLSS support includes:</P
99 >Support for downloading printer driver
100 files to Windows 95/98/NT/2000 clients upon demand.
105 >Uploading of printer drivers via the
106 Windows NT Add Printer Wizard (APW) or the
107 Imprints tool set (refer to <A
108 HREF="http://imprints.sourceforge.net"
110 >http://imprints.sourceforge.net</A
116 >Support for the native MS-RPC printing
117 calls such as StartDocPrinter, EnumJobs(), etc... (See
118 the MSDN documentation at <A
119 HREF="http://msdn.microsoft.com/"
121 >http://msdn.microsoft.com/</A
123 for more information on the Win32 printing API)
128 >Support for NT Access Control Lists (ACL)
129 on printer objects</P
133 >Improved support for printer queue manipulation
134 through the use of an internal databases for spooled job
139 >There has been some initial confusion about what all this means
140 and whether or not it is a requirement for printer drivers to be
141 installed on a Samba host in order to support printing from Windows
142 clients. As a side note, Samba does not use these drivers in any way to process
143 spooled files. They are utilized entirely by the clients.</P
145 >The following MS KB article, may be of some help if you are dealing with
146 Windows 2000 clients: <SPAN
150 >How to Add Printers with No User
151 Interaction in Windows 2000</I
156 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
158 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
168 >13.2. Configuration</H1
183 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
190 >[print$] vs. [printer$]</B
200 >Previous versions of Samba recommended using a share named [printer$].
201 This name was taken from the printer$ service created by Windows 9x
202 clients when a printer was shared. Windows 9x printer servers always have
203 a printer$ service which provides read-only access via no
204 password in order to support printer driver downloads.</P
206 >However, the initial implementation allowed for a
210 >printer driver location</I
213 to be used on a per share basis to specify the location of
214 the driver files associated with that printer. Another
221 a means of defining the printer driver name to be sent to
234 >13.2.1. Creating [print$]</H2
236 >In order to support the uploading of printer driver
237 files, you must first configure a file share named [print$].
238 The name of this share is hard coded in Samba's internals so
239 the name is very important (print$ is the service used by
240 Windows NT print servers to provide support for printer driver
243 >You should modify the server's smb.conf file to add the global
244 parameters and to create the
245 following file share (of course, some of the parameter values,
246 such as 'path' are arbitrary and should be replaced with
247 appropriate values for your site):</P
250 CLASS="PROGRAMLISTING"
252 ; members of the ntadmin group should be able
253 ; to add drivers and set printer properties
254 ; root is implicitly a 'printer admin'
255 printer admin = @ntadmin
258 path = /usr/local/samba/printers
262 ; since this share is configured as read only, then we need
263 ; a 'write list'. Check the file system permissions to make
264 ; sure this account can copy files to the share. If this
265 ; is setup to a non-root account, then it should also exist
266 ; as a 'printer admin'
267 write list = @ntadmin,root</PRE
271 HREF="smb.conf.5.html#WRITELIST"
279 > is used to allow administrative
280 level user accounts to have write access in order to update files
281 on the share. See the <A
282 HREF="smb.conf.5.html"
286 > for more information on configuring file shares.</P
288 >The requirement for <A
289 HREF="smb.conf.5.html#GUESTOK"
296 > depends upon how your
297 site is configured. If users will be guaranteed to have
298 an account on the Samba host, then this is a non-issue.</P
313 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
330 >The non-issue is that if all your Windows NT users are guaranteed to be
331 authenticated by the Samba server (such as a domain member server and the NT
332 user has already been validated by the Domain Controller in
333 order to logon to the Windows NT console), then guest access
334 is not necessary. Of course, in a workgroup environment where
335 you just want to be able to print without worrying about
336 silly accounts and security, then configure the share for
337 guest access. You'll probably want to add <A
338 HREF="smb.conf.5.html#MAPTOGUEST"
342 >map to guest = Bad User</B
344 > in the [global] section as well. Make sure
345 you understand what this parameter does before using it
352 >In order for a Windows NT print server to support
353 the downloading of driver files by multiple client architectures,
354 it must create subdirectories within the [print$] service
355 which correspond to each of the supported client architectures.
356 Samba follows this model as well.</P
358 >Next create the directory tree below the [print$] share
359 for each architecture you wish to support.</P
362 CLASS="PROGRAMLISTING"
364 |-W32X86 ; "Windows NT x86"
365 |-WIN40 ; "Windows 95/98"
366 |-W32ALPHA ; "Windows NT Alpha_AXP"
367 |-W32MIPS ; "Windows NT R4000"
368 |-W32PPC ; "Windows NT PowerPC"</PRE
384 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
391 >ATTENTION! REQUIRED PERMISSIONS</B
401 >In order to currently add a new driver to you Samba host,
402 one of two conditions must hold true:</P
408 >The account used to connect to the Samba host
409 must have a uid of 0 (i.e. a root account)</P
413 >The account used to connect to the Samba host
414 must be a member of the <A
415 HREF="smb.conf.5.html#PRINTERADMIN"
428 >Of course, the connected account must still possess access
429 to add files to the subdirectories beneath [print$]. Remember
430 that all file shares are set to 'read only' by default.</P
436 >Once you have created the required [print$] service and
437 associated subdirectories, simply log onto the Samba server using
444 from a Windows NT 4.0/2k client. Open "Network Neighbourhood" or
445 "My Network Places" and browse for the Samba host. Once you have located
446 the server, navigate to the "Printers..." folder.
447 You should see an initial listing of printers
448 that matches the printer shares defined on your Samba host.</P
457 >13.2.2. Setting Drivers for Existing Printers</H2
459 >The initial listing of printers in the Samba host's
460 Printers folder will have no real printer driver assigned
461 to them. This defaults to a NULL string to allow the use
462 of the local Add Printer Wizard on NT/2000 clients.
463 Attempting to view the printer properties for a printer
464 which has this default driver assigned will result in
465 the error message:</P
471 >Device settings cannot be displayed. The driver
472 for the specified printer is not installed, only spooler
473 properties will be displayed. Do you want to install the
478 >Click "No" in the error dialog and you will be presented with
479 the printer properties window. The way to assign a driver to a
480 printer is to either</P
486 >Use the "New Driver..." button to install
487 a new printer driver, or</P
491 >Select a driver from the popup list of
492 installed drivers. Initially this list will be empty.</P
496 >If you wish to install printer drivers for client
497 operating systems other than "Windows NT x86", you will need
498 to use the "Sharing" tab of the printer properties dialog.</P
500 >Assuming you have connected with a root account, you
501 will also be able modify other printer properties such as
502 ACLs and device settings using this dialog box.</P
504 >A few closing comments for this section, it is possible
505 on a Windows NT print server to have printers
506 listed in the Printers folder which are not shared. Samba does
507 not make this distinction. By definition, the only printers of
508 which Samba is aware are those which are specified as shares in
514 >Another interesting side note is that Windows NT clients do
515 not use the SMB printer share, but rather can print directly
516 to any printer on another Windows NT host using MS-RPC. This
517 of course assumes that the printing client has the necessary
518 privileges on the remote host serving the printer. The default
519 permissions assigned by Windows NT to a printer gives the "Print"
520 permissions to the "Everyone" well-known group.</P
529 >13.2.3. Support a large number of printers</H2
531 >One issue that has arisen during the development
532 phase of Samba 2.2 is the need to support driver downloads for
533 100's of printers. Using the Windows NT APW is somewhat
534 awkward to say the list. If more than one printer are using the
536 HREF="rpcclient.1.html"
543 > can be used to set the driver
544 associated with an installed driver. The following is example
545 of how this could be accomplished:</P
548 CLASS="PROGRAMLISTING"
553 >rpcclient pogo -U root%secret -c "enumdrivers"
554 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
557 Printer Driver Info 1:
558 Driver Name: [HP LaserJet 4000 Series PS]
560 Printer Driver Info 1:
561 Driver Name: [HP LaserJet 2100 Series PS]
563 Printer Driver Info 1:
564 Driver Name: [HP LaserJet 4Si/4SiMX PS]
569 >rpcclient pogo -U root%secret -c "enumprinters"
570 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
572 name:[\\POGO\hp-print]
573 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
579 >rpcclient pogo -U root%secret \
583 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
584 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
585 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
595 >13.2.4. Adding New Printers via the Windows NT APW</H2
597 >By default, Samba offers all printer shares defined in <TT
601 in the "Printers..." folder. Also existing in this folder is the Windows NT
602 Add Printer Wizard icon. The APW will be show only if</P
608 >The connected user is able to successfully
609 execute an OpenPrinterEx(\\server) with administrative
610 privileges (i.e. root or <TT
621 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
627 add printer wizard = yes</I
635 >In order to be able to use the APW to successfully add a printer to a Samba
637 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
646 > must have a defined value. The program
647 hook must successfully add the printer to the system (i.e.
651 > or appropriate files) and
657 >When using the APW from a client, if the named printer share does
661 > will execute the <TT
667 > and reparse to the <TT
671 to attempt to locate the new printer share. If the share is still not defined,
672 an error of "Access Denied" is returned to the client. Note that the
676 >add printer program</I
678 > is executed under the context
679 of the connected user, not necessarily a root account.</P
681 >There is a complementary <A
682 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
691 > for removing entries from the "Printers..."
694 >The following is an example <A
695 HREF="smb.conf.5.html#ADDPRINTERCOMMAN"
700 >add printer command</I
703 > script. It adds the appropriate entries to <TT
705 >/etc/printcap.local</TT
706 > (change that to what you need) and returns a line of 'Done' which is needed for the whole process to work.</P
708 CLASS="PROGRAMLISTING"
711 # Script to insert a new printer entry into printcap.local
713 # $1, printer name, used as the descriptive name
714 # $2, share name, used as the printer name for Linux
717 # $5, location, used for the device file of the printer
721 # Make sure we use the location that RedHat uses for local printer defs
722 PRINTCAP=/etc/printcap.local
723 DATE=`date +%Y%m%d-%H%M%S`
725 RESTART="service lpd restart"
728 cp $PRINTCAP $PRINTCAP.$DATE
729 # Add the printer to $PRINTCAP
730 echo "" >> $PRINTCAP
731 echo "$2|$1:\\" >> $PRINTCAP
732 echo " :sd=/var/spool/lpd/$2:\\" >> $PRINTCAP
733 echo " :mx=0:ml=0:sh:\\" >> $PRINTCAP
734 echo " :lp=/usr/local/samba/var/print/$5.prn:" >> $PRINTCAP
736 touch "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1
737 chown $LP "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1
739 mkdir /var/spool/lpd/$2
740 chmod 700 /var/spool/lpd/$2
741 chown $LP /var/spool/lpd/$2
742 #echo $1 >> "/usr/local/samba/var/print/$5.prn"
743 #echo $2 >> "/usr/local/samba/var/print/$5.prn"
744 #echo $3 >> "/usr/local/samba/var/print/$5.prn"
745 #echo $4 >> "/usr/local/samba/var/print/$5.prn"
746 #echo $5 >> "/usr/local/samba/var/print/$5.prn"
747 #echo $6 >> "/usr/local/samba/var/print/$5.prn"
748 $RESTART >> "/usr/local/samba/var/print/$5.prn"
749 # Not sure if this is needed
750 touch /usr/local/samba/lib/smb.conf
752 # You need to return a value, but I am not sure what it means.
764 >13.2.5. Samba and Printer Ports</H2
766 >Windows NT/2000 print servers associate a port with each printer. These normally
767 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
768 concept of ports associated with a printer. By default, only one printer port,
769 named "Samba Printer Port", exists on a system. Samba does not really a port in
770 order to print, rather it is a requirement of Windows clients. </P
772 >Note that Samba does not support the concept of "Printer Pooling" internally
773 either. This is when a logical printer is assigned to multiple ports as
774 a form of load balancing or fail over.</P
776 >If you require that multiple ports be defined for some reason,
781 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
790 > which can be used to define an external program
791 that generates a listing of ports on a system.</P
801 >13.3. The Imprints Toolset</H1
803 >The Imprints tool set provides a UNIX equivalent of the
804 Windows NT Add Printer Wizard. For complete information, please
805 refer to the Imprints web site at <A
806 HREF="http://imprints.sourceforge.net/"
808 > http://imprints.sourceforge.net/</A
809 > as well as the documentation
810 included with the imprints source distribution. This section will
811 only provide a brief introduction to the features of Imprints.</P
819 >13.3.1. What is Imprints?</H2
821 >Imprints is a collection of tools for supporting the goals
828 >Providing a central repository information
829 regarding Windows NT and 95/98 printer driver packages</P
833 >Providing the tools necessary for creating
834 the Imprints printer driver packages.</P
838 >Providing an installation client which
839 will obtain and install printer drivers on remote Samba
840 and Windows NT 4 print servers.</P
851 >13.3.2. Creating Printer Driver Packages</H2
853 >The process of creating printer driver packages is beyond
854 the scope of this document (refer to Imprints.txt also included
855 with the Samba distribution for more information). In short,
856 an Imprints driver package is a gzipped tarball containing the
857 driver files, related INF files, and a control file needed by the
858 installation client.</P
867 >13.3.3. The Imprints server</H2
869 >The Imprints server is really a database server that
870 may be queried via standard HTTP mechanisms. Each printer
871 entry in the database has an associated URL for the actual
872 downloading of the package. Each package is digitally signed
873 via GnuPG which can be used to verify that package downloaded
874 is actually the one referred in the Imprints database. It is
881 > recommended that this security check
891 >13.3.4. The Installation Client</H2
893 >More information regarding the Imprints installation client
894 is available in the <TT
896 >Imprints-Client-HOWTO.ps</TT
898 file included with the imprints source package.</P
900 >The Imprints installation client comes in two forms.</P
906 >a set of command line Perl scripts</P
910 >a GTK+ based graphical interface to
911 the command line perl scripts</P
915 >The installation client (in both forms) provides a means
916 of querying the Imprints database server for a matching
917 list of known printer model names as well as a means to
918 download and install the drivers on remote Samba and Windows
921 >The basic installation process is in four steps and
922 perl code is wrapped around <B
932 CLASS="PROGRAMLISTING"
934 foreach (supported architecture for a given driver)
936 1. rpcclient: Get the appropriate upload directory
938 2. smbclient: Upload the driver files
939 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
942 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
943 create the printer</PRE
946 >One of the problems encountered when implementing
947 the Imprints tool set was the name space issues between
948 various supported client architectures. For example, Windows
949 NT includes a driver named "Apple LaserWriter II NTX v51.8"
950 and Windows 95 calls its version of this driver "Apple
951 LaserWriter II NTX"</P
953 >The problem is how to know what client drivers have
954 been uploaded for a printer. As astute reader will remember
955 that the Windows NT Printer Properties dialog only includes
956 space for one printer driver name. A quick look in the
957 Windows NT 4.0 system registry at</P
961 >HKLM\System\CurrentControlSet\Control\Print\Environment
965 >will reveal that Windows NT always uses the NT driver
966 name. This is ok as Windows NT always requires that at least
967 the Windows NT version of the printer driver is present.
968 However, Samba does not have the requirement internally.
969 Therefore, how can you use the NT driver name if is has not
970 already been installed?</P
972 >The way of sidestepping this limitation is to require
973 that all Imprints printer driver packages include both the Intel
974 Windows NT and 95/98 printer drivers and that NT driver is
993 >13.4.1. Introduction</H2
995 >This is a short description of how to debug printing problems with
996 Samba. This describes how to debug problems with printing from a SMB
997 client to a Samba server, not the other way around. For the reverse
998 see the examples/printing directory.</P
1000 >Ok, so you want to print to a Samba server from your PC. The first
1001 thing you need to understand is that Samba does not actually do any
1002 printing itself, it just acts as a middleman between your PC client
1003 and your Unix printing subsystem. Samba receives the file from the PC
1004 then passes the file to a external "print command". What print command
1005 you use is up to you.</P
1007 >The whole things is controlled using options in smb.conf. The most
1008 relevant options (which you should look up in the smb.conf man page)
1012 CLASS="PROGRAMLISTING"
1014 print command - send a file to a spooler
1015 lpq command - get spool queue status
1016 lprm command - remove a job
1018 path = /var/spool/lpd/samba</PRE
1021 >The following are nice to know about:</P
1024 CLASS="PROGRAMLISTING"
1025 > queuepause command - stop a printer or print queue
1026 queueresume command - start a printer or print queue</PRE
1032 CLASS="PROGRAMLISTING"
1033 > print command = /usr/bin/lpr -r -P%p %s
1034 lpq command = /usr/bin/lpq -P%p %s
1035 lprm command = /usr/bin/lprm -P%p %j
1036 queuepause command = /usr/sbin/lpc -P%p stop
1037 queuepause command = /usr/sbin/lpc -P%p start</PRE
1040 >Samba should set reasonable defaults for these depending on your
1041 system type, but it isn't clairvoyant. It is not uncommon that you
1042 have to tweak these for local conditions. The commands should
1043 always have fully specified pathnames, as the smdb may not have
1044 the correct PATH values.</P
1046 >When you send a job to Samba to be printed, it will make a temporary
1047 copy of it in the directory specified in the [printers] section.
1048 and it should be periodically cleaned out. The lpr -r option
1049 requests that the temporary copy be removed after printing; If
1050 printing fails then you might find leftover files in this directory,
1051 and it should be periodically cleaned out. Samba used the lpq
1052 command to determine the "job number" assigned to your print job
1055 >The %>letter< are "macros" that get dynamically replaced with appropriate
1056 values when they are used. The %s gets replaced with the name of the spool
1057 file that Samba creates and the %p gets replaced with the name of the
1058 printer. The %j gets replaced with the "job number" which comes from
1068 >13.4.2. Debugging printer problems</H2
1070 >One way to debug printing problems is to start by replacing these
1071 command with shell scripts that record the arguments and the contents
1072 of the print file. A simple example of this kind of things might
1076 CLASS="PROGRAMLISTING"
1077 > print command = /tmp/saveprint %p %s
1080 # we make sure that we are the right user
1081 /usr/bin/id -p >/tmp/tmp.print
1082 # we run the command and save the error messages
1083 # replace the command with the one appropriate for your system
1084 /usr/bin/lpr -r -P$1 $2 2>>&/tmp/tmp.print</PRE
1087 >Then you print a file and try removing it. You may find that the
1088 print queue needs to be stopped in order to see the queue status
1089 and remove the job:</P
1092 CLASS="PROGRAMLISTING"
1093 > h4: {42} % echo hi >/tmp/hi
1094 h4: {43} % smbclient //localhost/lw4
1095 added interface ip=10.0.0.4 bcast=10.0.0.255 nmask=255.255.255.0
1097 Domain=[ASTART] OS=[Unix] Server=[Samba 2.0.7]
1098 smb: \> print /tmp/hi
1099 putting file /tmp/hi as hi-17534 (0.0 kb/s) (average 0.0 kb/s)
1102 smb: \> cancel 1049
1103 Error cancelling job 1049 : code 0
1104 smb: \> cancel 1049
1107 smb: \> exit</PRE
1110 >The 'code 0' indicates that the job was removed. The comment
1111 by the smbclient is a bit misleading on this.
1112 You can observe the command output and then and look at the
1113 /tmp/tmp.print file to see what the results are. You can quickly
1114 find out if the problem is with your printing system. Often people
1115 have problems with their /etc/printcap file or permissions on
1116 various print queues.</P
1125 >13.4.3. What printers do I have?</H2
1127 >You can use the 'testprns' program to check to see if the printer
1128 name you are using is recognized by Samba. For example, you can
1132 CLASS="PROGRAMLISTING"
1133 > testprns printer /etc/printcap</PRE
1136 >Samba can get its printcap information from a file or from a program.
1137 You can try the following to see the format of the extracted
1141 CLASS="PROGRAMLISTING"
1142 > testprns -a printer /etc/printcap
1144 testprns -a printer '|/bin/cat printcap'</PRE
1154 >13.4.4. Setting up printcap and print servers</H2
1156 >You may need to set up some printcaps for your Samba system to use.
1157 It is strongly recommended that you use the facilities provided by
1158 the print spooler to set up queues and printcap information.</P
1160 >Samba requires either a printcap or program to deliver printcap
1161 information. This printcap information has the format:</P
1164 CLASS="PROGRAMLISTING"
1165 > name|alias1|alias2...:option=value:...</PRE
1168 >For almost all printing systems, the printer 'name' must be composed
1169 only of alphanumeric or underscore '_' characters. Some systems also
1170 allow hyphens ('-') as well. An alias is an alternative name for the
1171 printer, and an alias with a space in it is used as a 'comment'
1172 about the printer. The printcap format optionally uses a \ at the end of lines
1173 to extend the printcap to multiple lines.</P
1175 >Here are some examples of printcap files:</P
1183 >pr just printer name</P
1187 >pr|alias printer name and alias</P
1191 >pr|My Printer printer name, alias used as comment</P
1195 >pr:sh:\ Same as pr:sh:cm= testing
1201 >pr:sh Same as pr:sh:cm= testing
1207 >Samba reads the printcap information when first started. If you make
1208 changes in the printcap information, then you must do the following:</P
1215 >make sure that the print spooler is aware of these changes.
1216 The LPRng system uses the 'lpc reread' command to do this.</P
1220 >make sure that the spool queues, etc., exist and have the
1221 correct permissions. The LPRng system uses the 'checkpc -f'
1222 command to do this.</P
1226 >You now should send a SIGHUP signal to the smbd server to have
1227 it reread the printcap information.</P
1238 >13.4.5. Job sent, no output</H2
1240 >This is the most frustrating part of printing. You may have sent the
1241 job, verified that the job was forwarded, set up a wrapper around
1242 the command to send the file, but there was no output from the printer.</P
1244 >First, check to make sure that the job REALLY is getting to the
1245 right print queue. If you are using a BSD or LPRng print spooler,
1246 you can temporarily stop the printing of jobs. Jobs can still be
1247 submitted, but they will not be printed. Use:</P
1250 CLASS="PROGRAMLISTING"
1251 > lpc -Pprinter stop</PRE
1254 >Now submit a print job and then use 'lpq -Pprinter' to see if the
1255 job is in the print queue. If it is not in the print queue then
1256 you will have to find out why it is not being accepted for printing.</P
1258 >Next, you may want to check to see what the format of the job really
1259 was. With the assistance of the system administrator you can view
1260 the submitted jobs files. You may be surprised to find that these
1261 are not in what you would expect to call a printable format.
1262 You can use the UNIX 'file' utitily to determine what the job
1263 format actually is:</P
1266 CLASS="PROGRAMLISTING"
1267 > cd /var/spool/lpd/printer # spool directory of print jobs
1269 file dfA001myhost</PRE
1272 >You should make sure that your printer supports this format OR that
1273 your system administrator has installed a 'print filter' that will
1274 convert the file to a format appropriate for your printer.</P
1283 >13.4.6. Job sent, strange output</H2
1285 >Once you have the job printing, you can then start worrying about
1286 making it print nicely.</P
1288 >The most common problem is extra pages of output: banner pages
1289 OR blank pages at the end.</P
1291 >If you are getting banner pages, check and make sure that the
1292 printcap option or printer option is configured for no banners.
1293 If you have a printcap, this is the :sh (suppress header or banner
1294 page) option. You should have the following in your printer.</P
1297 CLASS="PROGRAMLISTING"
1298 > printer: ... :sh</PRE
1301 >If you have this option and are still getting banner pages, there
1302 is a strong chance that your printer is generating them for you
1303 automatically. You should make sure that banner printing is disabled
1304 for the printer. This usually requires using the printer setup software
1305 or procedures supplied by the printer manufacturer.</P
1307 >If you get an extra page of output, this could be due to problems
1308 with your job format, or if you are generating PostScript jobs,
1309 incorrect setting on your printer driver on the MicroSoft client.
1310 For example, under Win95 there is a option:</P
1313 CLASS="PROGRAMLISTING"
1314 > Printers|Printer Name|(Right Click)Properties|Postscript|Advanced|</PRE
1317 >that allows you to choose if a Ctrl-D is appended to all jobs.
1318 This is a very bad thing to do, as most spooling systems will
1319 automatically add a ^D to the end of the job if it is detected as
1320 PostScript. The multiple ^D may cause an additional page of output.</P
1329 >13.4.7. Raw PostScript printed</H2
1331 >This is a problem that is usually caused by either the print spooling
1332 system putting information at the start of the print job that makes
1333 the printer think the job is a text file, or your printer simply
1334 does not support PostScript. You may need to enable 'Automatic
1335 Format Detection' on your printer.</P
1344 >13.4.8. Advanced Printing</H2
1346 >Note that you can do some pretty magic things by using your
1347 imagination with the "print command" option and some shell scripts.
1348 Doing print accounting is easy by passing the %U option to a print
1349 command shell script. You could even make the print command detect
1350 the type of output and its size and send it to an appropriate
1360 >13.4.9. Real debugging</H2
1362 >If the above debug tips don't help, then maybe you need to bring in
1363 the bug guns, system tracing. See Tracing.txt in this directory.</P
1372 SUMMARY="Footer navigation table"
1392 HREF="samba-howto-collection.html"
1411 >Hosting a Microsoft Distributed File System tree on Samba</TD
1417 HREF="optional.html"
1425 >Unified Logons between Windows NT and UNIX using Winbind</TD