1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >Printing Support</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
11 TITLE="SAMBA Project Documentation"
12 HREF="samba-howto-collection.html"><LINK
14 TITLE="Optional configuration"
15 HREF="optional.html"><LINK
17 TITLE="Hosting a Microsoft Distributed File System tree on Samba"
18 HREF="msdfs.html"><LINK
20 TITLE="Unified Logons between Windows NT and UNIX using Winbind"
21 HREF="winbind.html"></HEAD
32 SUMMARY="Header navigation table"
41 >SAMBA Project Documentation</TH
76 NAME="PRINTING">Chapter 14. Printing Support</H1
82 NAME="AEN1920">14.1. Introduction</H1
84 >Beginning with the 2.2.0 release, Samba supports
85 the native Windows NT printing mechanisms implemented via
86 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
87 Samba only supported LanMan printing calls.</P
89 >The additional functionality provided by the new
90 SPOOLSS support includes:</P
96 >Support for downloading printer driver
97 files to Windows 95/98/NT/2000 clients upon demand.
102 >Uploading of printer drivers via the
103 Windows NT Add Printer Wizard (APW) or the
104 Imprints tool set (refer to <A
105 HREF="http://imprints.sourceforge.net"
107 >http://imprints.sourceforge.net</A
113 >Support for the native MS-RPC printing
114 calls such as StartDocPrinter, EnumJobs(), etc... (See
115 the MSDN documentation at <A
116 HREF="http://msdn.microsoft.com/"
118 >http://msdn.microsoft.com/</A
120 for more information on the Win32 printing API)
125 >Support for NT Access Control Lists (ACL)
126 on printer objects</P
130 >Improved support for printer queue manipulation
131 through the use of an internal databases for spooled job
136 >There has been some initial confusion about what all this means
137 and whether or not it is a requirement for printer drivers to be
138 installed on a Samba host in order to support printing from Windows
139 clients. As a side note, Samba does not use these drivers in any way to process
140 spooled files. They are utilized entirely by the clients.</P
142 >The following MS KB article, may be of some help if you are dealing with
143 Windows 2000 clients: <SPAN
147 >How to Add Printers with No User
148 Interaction in Windows 2000</I
153 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
155 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
163 NAME="AEN1942">14.2. Configuration</H1
178 SRC="../images/warning.gif"
185 >[print$] vs. [printer$]</B
195 >Previous versions of Samba recommended using a share named [printer$].
196 This name was taken from the printer$ service created by Windows 9x
197 clients when a printer was shared. Windows 9x printer servers always have
198 a printer$ service which provides read-only access via no
199 password in order to support printer driver downloads.</P
201 >However, the initial implementation allowed for a
205 >printer driver location</I
208 to be used on a per share basis to specify the location of
209 the driver files associated with that printer. Another
216 a means of defining the printer driver name to be sent to
227 NAME="AEN1950">14.2.1. Creating [print$]</H2
229 >In order to support the uploading of printer driver
230 files, you must first configure a file share named [print$].
231 The name of this share is hard coded in Samba's internals so
232 the name is very important (print$ is the service used by
233 Windows NT print servers to provide support for printer driver
236 >You should modify the server's smb.conf file to add the global
237 parameters and to create the
238 following file share (of course, some of the parameter values,
239 such as 'path' are arbitrary and should be replaced with
240 appropriate values for your site):</P
243 CLASS="PROGRAMLISTING"
245 ; members of the ntadmin group should be able
246 ; to add drivers and set printer properties
247 ; root is implicitly a 'printer admin'
248 printer admin = @ntadmin
251 path = /usr/local/samba/printers
255 ; since this share is configured as read only, then we need
256 ; a 'write list'. Check the file system permissions to make
257 ; sure this account can copy files to the share. If this
258 ; is setup to a non-root account, then it should also exist
259 ; as a 'printer admin'
260 write list = @ntadmin,root</PRE
264 HREF="smb.conf.5.html#WRITELIST"
272 > is used to allow administrative
273 level user accounts to have write access in order to update files
274 on the share. See the <A
275 HREF="smb.conf.5.html"
279 > for more information on configuring file shares.</P
281 >The requirement for <A
282 HREF="smb.conf.5.html#GUESTOK"
289 > depends upon how your
290 site is configured. If users will be guaranteed to have
291 an account on the Samba host, then this is a non-issue.</P
306 SRC="../images/note.gif"
323 >The non-issue is that if all your Windows NT users are guaranteed to be
324 authenticated by the Samba server (such as a domain member server and the NT
325 user has already been validated by the Domain Controller in
326 order to logon to the Windows NT console), then guest access
327 is not necessary. Of course, in a workgroup environment where
328 you just want to be able to print without worrying about
329 silly accounts and security, then configure the share for
330 guest access. You'll probably want to add <A
331 HREF="smb.conf.5.html#MAPTOGUEST"
335 >map to guest = Bad User</B
337 > in the [global] section as well. Make sure
338 you understand what this parameter does before using it
345 >In order for a Windows NT print server to support
346 the downloading of driver files by multiple client architectures,
347 it must create subdirectories within the [print$] service
348 which correspond to each of the supported client architectures.
349 Samba follows this model as well.</P
351 >Next create the directory tree below the [print$] share
352 for each architecture you wish to support.</P
355 CLASS="PROGRAMLISTING"
357 |-W32X86 ; "Windows NT x86"
358 |-WIN40 ; "Windows 95/98"
359 |-W32ALPHA ; "Windows NT Alpha_AXP"
360 |-W32MIPS ; "Windows NT R4000"
361 |-W32PPC ; "Windows NT PowerPC"</PRE
377 SRC="../images/warning.gif"
384 >ATTENTION! REQUIRED PERMISSIONS</B
394 >In order to currently add a new driver to you Samba host,
395 one of two conditions must hold true:</P
401 >The account used to connect to the Samba host
402 must have a uid of 0 (i.e. a root account)</P
406 >The account used to connect to the Samba host
407 must be a member of the <A
408 HREF="smb.conf.5.html#PRINTERADMIN"
421 >Of course, the connected account must still possess access
422 to add files to the subdirectories beneath [print$]. Remember
423 that all file shares are set to 'read only' by default.</P
429 >Once you have created the required [print$] service and
430 associated subdirectories, simply log onto the Samba server using
437 from a Windows NT 4.0/2k client. Open "Network Neighbourhood" or
438 "My Network Places" and browse for the Samba host. Once you have located
439 the server, navigate to the "Printers..." folder.
440 You should see an initial listing of printers
441 that matches the printer shares defined on your Samba host.</P
448 NAME="AEN1985">14.2.2. Setting Drivers for Existing Printers</H2
450 >The initial listing of printers in the Samba host's
451 Printers folder will have no real printer driver assigned
452 to them. This defaults to a NULL string to allow the use
453 of the local Add Printer Wizard on NT/2000 clients.
454 Attempting to view the printer properties for a printer
455 which has this default driver assigned will result in
456 the error message:</P
462 >Device settings cannot be displayed. The driver
463 for the specified printer is not installed, only spooler
464 properties will be displayed. Do you want to install the
469 >Click "No" in the error dialog and you will be presented with
470 the printer properties window. The way to assign a driver to a
471 printer is to either</P
477 >Use the "New Driver..." button to install
478 a new printer driver, or</P
482 >Select a driver from the popup list of
483 installed drivers. Initially this list will be empty.</P
487 >If you wish to install printer drivers for client
488 operating systems other than "Windows NT x86", you will need
489 to use the "Sharing" tab of the printer properties dialog.</P
491 >Assuming you have connected with a root account, you
492 will also be able modify other printer properties such as
493 ACLs and device settings using this dialog box.</P
495 >A few closing comments for this section, it is possible
496 on a Windows NT print server to have printers
497 listed in the Printers folder which are not shared. Samba does
498 not make this distinction. By definition, the only printers of
499 which Samba is aware are those which are specified as shares in
505 >Another interesting side note is that Windows NT clients do
506 not use the SMB printer share, but rather can print directly
507 to any printer on another Windows NT host using MS-RPC. This
508 of course assumes that the printing client has the necessary
509 privileges on the remote host serving the printer. The default
510 permissions assigned by Windows NT to a printer gives the "Print"
511 permissions to the "Everyone" well-known group.</P
518 NAME="AEN2001">14.2.3. Support a large number of printers</H2
520 >One issue that has arisen during the development
521 phase of Samba 2.2 is the need to support driver downloads for
522 100's of printers. Using the Windows NT APW is somewhat
523 awkward to say the list. If more than one printer are using the
525 HREF="rpcclient.1.html"
532 > can be used to set the driver
533 associated with an installed driver. The following is example
534 of how this could be accomplished:</P
537 CLASS="PROGRAMLISTING"
542 >rpcclient pogo -U root%secret -c "enumdrivers"
543 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
546 Printer Driver Info 1:
547 Driver Name: [HP LaserJet 4000 Series PS]
549 Printer Driver Info 1:
550 Driver Name: [HP LaserJet 2100 Series PS]
552 Printer Driver Info 1:
553 Driver Name: [HP LaserJet 4Si/4SiMX PS]
558 >rpcclient pogo -U root%secret -c "enumprinters"
559 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
561 name:[\\POGO\hp-print]
562 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
568 >rpcclient pogo -U root%secret \
572 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
573 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
574 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
582 NAME="AEN2012">14.2.4. Adding New Printers via the Windows NT APW</H2
584 >By default, Samba offers all printer shares defined in <TT
588 in the "Printers..." folder. Also existing in this folder is the Windows NT
589 Add Printer Wizard icon. The APW will be show only if</P
595 >The connected user is able to successfully
596 execute an OpenPrinterEx(\\server) with administrative
597 privileges (i.e. root or <TT
608 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
614 add printer wizard = yes</I
622 >In order to be able to use the APW to successfully add a printer to a Samba
624 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
633 > must have a defined value. The program
634 hook must successfully add the printer to the system (i.e.
638 > or appropriate files) and
644 >When using the APW from a client, if the named printer share does
648 > will execute the <TT
654 > and reparse to the <TT
658 to attempt to locate the new printer share. If the share is still not defined,
659 an error of "Access Denied" is returned to the client. Note that the
663 >add printer program</I
665 > is executed under the context
666 of the connected user, not necessarily a root account.</P
668 >There is a complementary <A
669 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
678 > for removing entries from the "Printers..."
681 >The following is an example <A
682 HREF="smb.conf.5.html#ADDPRINTERCOMMAN"
687 >add printer command</I
690 > script. It adds the appropriate entries to <TT
692 >/etc/printcap.local</TT
693 > (change that to what you need) and returns a line of 'Done' which is needed for the whole process to work.</P
695 CLASS="PROGRAMLISTING"
698 # Script to insert a new printer entry into printcap.local
700 # $1, printer name, used as the descriptive name
701 # $2, share name, used as the printer name for Linux
704 # $5, location, used for the device file of the printer
708 # Make sure we use the location that RedHat uses for local printer defs
709 PRINTCAP=/etc/printcap.local
710 DATE=`date +%Y%m%d-%H%M%S`
712 RESTART="service lpd restart"
715 cp $PRINTCAP $PRINTCAP.$DATE
716 # Add the printer to $PRINTCAP
717 echo "" >> $PRINTCAP
718 echo "$2|$1:\\" >> $PRINTCAP
719 echo " :sd=/var/spool/lpd/$2:\\" >> $PRINTCAP
720 echo " :mx=0:ml=0:sh:\\" >> $PRINTCAP
721 echo " :lp=/usr/local/samba/var/print/$5.prn:" >> $PRINTCAP
723 touch "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1
724 chown $LP "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1
726 mkdir /var/spool/lpd/$2
727 chmod 700 /var/spool/lpd/$2
728 chown $LP /var/spool/lpd/$2
729 #echo $1 >> "/usr/local/samba/var/print/$5.prn"
730 #echo $2 >> "/usr/local/samba/var/print/$5.prn"
731 #echo $3 >> "/usr/local/samba/var/print/$5.prn"
732 #echo $4 >> "/usr/local/samba/var/print/$5.prn"
733 #echo $5 >> "/usr/local/samba/var/print/$5.prn"
734 #echo $6 >> "/usr/local/samba/var/print/$5.prn"
735 $RESTART >> "/usr/local/samba/var/print/$5.prn"
736 # Not sure if this is needed
737 touch /usr/local/samba/lib/smb.conf
739 # You need to return a value, but I am not sure what it means.
749 NAME="AEN2042">14.2.5. Samba and Printer Ports</H2
751 >Windows NT/2000 print servers associate a port with each printer. These normally
752 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
753 concept of ports associated with a printer. By default, only one printer port,
754 named "Samba Printer Port", exists on a system. Samba does not really a port in
755 order to print, rather it is a requirement of Windows clients. </P
757 >Note that Samba does not support the concept of "Printer Pooling" internally
758 either. This is when a logical printer is assigned to multiple ports as
759 a form of load balancing or fail over.</P
761 >If you require that multiple ports be defined for some reason,
766 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
775 > which can be used to define an external program
776 that generates a listing of ports on a system.</P
784 NAME="AEN2050">14.3. The Imprints Toolset</H1
786 >The Imprints tool set provides a UNIX equivalent of the
787 Windows NT Add Printer Wizard. For complete information, please
788 refer to the Imprints web site at <A
789 HREF="http://imprints.sourceforge.net/"
791 > http://imprints.sourceforge.net/</A
792 > as well as the documentation
793 included with the imprints source distribution. This section will
794 only provide a brief introduction to the features of Imprints.</P
800 NAME="AEN2054">14.3.1. What is Imprints?</H2
802 >Imprints is a collection of tools for supporting the goals
809 >Providing a central repository information
810 regarding Windows NT and 95/98 printer driver packages</P
814 >Providing the tools necessary for creating
815 the Imprints printer driver packages.</P
819 >Providing an installation client which
820 will obtain and install printer drivers on remote Samba
821 and Windows NT 4 print servers.</P
830 NAME="AEN2064">14.3.2. Creating Printer Driver Packages</H2
832 >The process of creating printer driver packages is beyond
833 the scope of this document (refer to Imprints.txt also included
834 with the Samba distribution for more information). In short,
835 an Imprints driver package is a gzipped tarball containing the
836 driver files, related INF files, and a control file needed by the
837 installation client.</P
844 NAME="AEN2067">14.3.3. The Imprints server</H2
846 >The Imprints server is really a database server that
847 may be queried via standard HTTP mechanisms. Each printer
848 entry in the database has an associated URL for the actual
849 downloading of the package. Each package is digitally signed
850 via GnuPG which can be used to verify that package downloaded
851 is actually the one referred in the Imprints database. It is
858 > recommended that this security check
866 NAME="AEN2071">14.3.4. The Installation Client</H2
868 >More information regarding the Imprints installation client
869 is available in the <TT
871 >Imprints-Client-HOWTO.ps</TT
873 file included with the imprints source package.</P
875 >The Imprints installation client comes in two forms.</P
881 >a set of command line Perl scripts</P
885 >a GTK+ based graphical interface to
886 the command line perl scripts</P
890 >The installation client (in both forms) provides a means
891 of querying the Imprints database server for a matching
892 list of known printer model names as well as a means to
893 download and install the drivers on remote Samba and Windows
896 >The basic installation process is in four steps and
897 perl code is wrapped around <B
907 CLASS="PROGRAMLISTING"
909 foreach (supported architecture for a given driver)
911 1. rpcclient: Get the appropriate upload directory
913 2. smbclient: Upload the driver files
914 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
917 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
918 create the printer</PRE
921 >One of the problems encountered when implementing
922 the Imprints tool set was the name space issues between
923 various supported client architectures. For example, Windows
924 NT includes a driver named "Apple LaserWriter II NTX v51.8"
925 and Windows 95 calls its version of this driver "Apple
926 LaserWriter II NTX"</P
928 >The problem is how to know what client drivers have
929 been uploaded for a printer. As astute reader will remember
930 that the Windows NT Printer Properties dialog only includes
931 space for one printer driver name. A quick look in the
932 Windows NT 4.0 system registry at</P
936 >HKLM\System\CurrentControlSet\Control\Print\Environment
940 >will reveal that Windows NT always uses the NT driver
941 name. This is ok as Windows NT always requires that at least
942 the Windows NT version of the printer driver is present.
943 However, Samba does not have the requirement internally.
944 Therefore, how can you use the NT driver name if is has not
945 already been installed?</P
947 >The way of sidestepping this limitation is to require
948 that all Imprints printer driver packages include both the Intel
949 Windows NT and 95/98 printer drivers and that NT driver is
958 NAME="AEN2093">14.4. Diagnosis</H1
964 NAME="AEN2095">14.4.1. Introduction</H2
966 >This is a short description of how to debug printing problems with
967 Samba. This describes how to debug problems with printing from a SMB
968 client to a Samba server, not the other way around. For the reverse
969 see the examples/printing directory.</P
971 >Ok, so you want to print to a Samba server from your PC. The first
972 thing you need to understand is that Samba does not actually do any
973 printing itself, it just acts as a middleman between your PC client
974 and your Unix printing subsystem. Samba receives the file from the PC
975 then passes the file to a external "print command". What print command
976 you use is up to you.</P
978 >The whole things is controlled using options in smb.conf. The most
979 relevant options (which you should look up in the smb.conf man page)
983 CLASS="PROGRAMLISTING"
985 print command - send a file to a spooler
986 lpq command - get spool queue status
987 lprm command - remove a job
989 path = /var/spool/lpd/samba</PRE
992 >The following are nice to know about:</P
995 CLASS="PROGRAMLISTING"
996 > queuepause command - stop a printer or print queue
997 queueresume command - start a printer or print queue</PRE
1003 CLASS="PROGRAMLISTING"
1004 > print command = /usr/bin/lpr -r -P%p %s
1005 lpq command = /usr/bin/lpq -P%p %s
1006 lprm command = /usr/bin/lprm -P%p %j
1007 queuepause command = /usr/sbin/lpc -P%p stop
1008 queuepause command = /usr/sbin/lpc -P%p start</PRE
1011 >Samba should set reasonable defaults for these depending on your
1012 system type, but it isn't clairvoyant. It is not uncommon that you
1013 have to tweak these for local conditions. The commands should
1014 always have fully specified pathnames, as the smdb may not have
1015 the correct PATH values.</P
1017 >When you send a job to Samba to be printed, it will make a temporary
1018 copy of it in the directory specified in the [printers] section.
1019 and it should be periodically cleaned out. The lpr -r option
1020 requests that the temporary copy be removed after printing; If
1021 printing fails then you might find leftover files in this directory,
1022 and it should be periodically cleaned out. Samba used the lpq
1023 command to determine the "job number" assigned to your print job
1026 >The %>letter< are "macros" that get dynamically replaced with appropriate
1027 values when they are used. The %s gets replaced with the name of the spool
1028 file that Samba creates and the %p gets replaced with the name of the
1029 printer. The %j gets replaced with the "job number" which comes from
1037 NAME="AEN2111">14.4.2. Debugging printer problems</H2
1039 >One way to debug printing problems is to start by replacing these
1040 command with shell scripts that record the arguments and the contents
1041 of the print file. A simple example of this kind of things might
1045 CLASS="PROGRAMLISTING"
1046 > print command = /tmp/saveprint %p %s
1049 # we make sure that we are the right user
1050 /usr/bin/id -p >/tmp/tmp.print
1051 # we run the command and save the error messages
1052 # replace the command with the one appropriate for your system
1053 /usr/bin/lpr -r -P$1 $2 2>>&/tmp/tmp.print</PRE
1056 >Then you print a file and try removing it. You may find that the
1057 print queue needs to be stopped in order to see the queue status
1058 and remove the job:</P
1061 CLASS="PROGRAMLISTING"
1062 > h4: {42} % echo hi >/tmp/hi
1063 h4: {43} % smbclient //localhost/lw4
1064 added interface ip=10.0.0.4 bcast=10.0.0.255 nmask=255.255.255.0
1066 Domain=[ASTART] OS=[Unix] Server=[Samba 2.0.7]
1067 smb: \> print /tmp/hi
1068 putting file /tmp/hi as hi-17534 (0.0 kb/s) (average 0.0 kb/s)
1071 smb: \> cancel 1049
1072 Error cancelling job 1049 : code 0
1073 smb: \> cancel 1049
1076 smb: \> exit</PRE
1079 >The 'code 0' indicates that the job was removed. The comment
1080 by the smbclient is a bit misleading on this.
1081 You can observe the command output and then and look at the
1082 /tmp/tmp.print file to see what the results are. You can quickly
1083 find out if the problem is with your printing system. Often people
1084 have problems with their /etc/printcap file or permissions on
1085 various print queues.</P
1092 NAME="AEN2120">14.4.3. What printers do I have?</H2
1094 >You can use the 'testprns' program to check to see if the printer
1095 name you are using is recognized by Samba. For example, you can
1099 CLASS="PROGRAMLISTING"
1100 > testprns printer /etc/printcap</PRE
1103 >Samba can get its printcap information from a file or from a program.
1104 You can try the following to see the format of the extracted
1108 CLASS="PROGRAMLISTING"
1109 > testprns -a printer /etc/printcap
1111 testprns -a printer '|/bin/cat printcap'</PRE
1119 NAME="AEN2128">14.4.4. Setting up printcap and print servers</H2
1121 >You may need to set up some printcaps for your Samba system to use.
1122 It is strongly recommended that you use the facilities provided by
1123 the print spooler to set up queues and printcap information.</P
1125 >Samba requires either a printcap or program to deliver printcap
1126 information. This printcap information has the format:</P
1129 CLASS="PROGRAMLISTING"
1130 > name|alias1|alias2...:option=value:...</PRE
1133 >For almost all printing systems, the printer 'name' must be composed
1134 only of alphanumeric or underscore '_' characters. Some systems also
1135 allow hyphens ('-') as well. An alias is an alternative name for the
1136 printer, and an alias with a space in it is used as a 'comment'
1137 about the printer. The printcap format optionally uses a \ at the end of lines
1138 to extend the printcap to multiple lines.</P
1140 >Here are some examples of printcap files:</P
1148 >pr just printer name</P
1152 >pr|alias printer name and alias</P
1156 >pr|My Printer printer name, alias used as comment</P
1160 >pr:sh:\ Same as pr:sh:cm= testing
1166 >pr:sh Same as pr:sh:cm= testing
1172 >Samba reads the printcap information when first started. If you make
1173 changes in the printcap information, then you must do the following:</P
1180 >make sure that the print spooler is aware of these changes.
1181 The LPRng system uses the 'lpc reread' command to do this.</P
1185 >make sure that the spool queues, etc., exist and have the
1186 correct permissions. The LPRng system uses the 'checkpc -f'
1187 command to do this.</P
1191 >You now should send a SIGHUP signal to the smbd server to have
1192 it reread the printcap information.</P
1201 NAME="AEN2156">14.4.5. Job sent, no output</H2
1203 >This is the most frustrating part of printing. You may have sent the
1204 job, verified that the job was forwarded, set up a wrapper around
1205 the command to send the file, but there was no output from the printer.</P
1207 >First, check to make sure that the job REALLY is getting to the
1208 right print queue. If you are using a BSD or LPRng print spooler,
1209 you can temporarily stop the printing of jobs. Jobs can still be
1210 submitted, but they will not be printed. Use:</P
1213 CLASS="PROGRAMLISTING"
1214 > lpc -Pprinter stop</PRE
1217 >Now submit a print job and then use 'lpq -Pprinter' to see if the
1218 job is in the print queue. If it is not in the print queue then
1219 you will have to find out why it is not being accepted for printing.</P
1221 >Next, you may want to check to see what the format of the job really
1222 was. With the assistance of the system administrator you can view
1223 the submitted jobs files. You may be surprised to find that these
1224 are not in what you would expect to call a printable format.
1225 You can use the UNIX 'file' utitily to determine what the job
1226 format actually is:</P
1229 CLASS="PROGRAMLISTING"
1230 > cd /var/spool/lpd/printer # spool directory of print jobs
1232 file dfA001myhost</PRE
1235 >You should make sure that your printer supports this format OR that
1236 your system administrator has installed a 'print filter' that will
1237 convert the file to a format appropriate for your printer.</P
1244 NAME="AEN2167">14.4.6. Job sent, strange output</H2
1246 >Once you have the job printing, you can then start worrying about
1247 making it print nicely.</P
1249 >The most common problem is extra pages of output: banner pages
1250 OR blank pages at the end.</P
1252 >If you are getting banner pages, check and make sure that the
1253 printcap option or printer option is configured for no banners.
1254 If you have a printcap, this is the :sh (suppress header or banner
1255 page) option. You should have the following in your printer.</P
1258 CLASS="PROGRAMLISTING"
1259 > printer: ... :sh</PRE
1262 >If you have this option and are still getting banner pages, there
1263 is a strong chance that your printer is generating them for you
1264 automatically. You should make sure that banner printing is disabled
1265 for the printer. This usually requires using the printer setup software
1266 or procedures supplied by the printer manufacturer.</P
1268 >If you get an extra page of output, this could be due to problems
1269 with your job format, or if you are generating PostScript jobs,
1270 incorrect setting on your printer driver on the MicroSoft client.
1271 For example, under Win95 there is a option:</P
1274 CLASS="PROGRAMLISTING"
1275 > Printers|Printer Name|(Right Click)Properties|Postscript|Advanced|</PRE
1278 >that allows you to choose if a Ctrl-D is appended to all jobs.
1279 This is a very bad thing to do, as most spooling systems will
1280 automatically add a ^D to the end of the job if it is detected as
1281 PostScript. The multiple ^D may cause an additional page of output.</P
1288 NAME="AEN2179">14.4.7. Raw PostScript printed</H2
1290 >This is a problem that is usually caused by either the print spooling
1291 system putting information at the start of the print job that makes
1292 the printer think the job is a text file, or your printer simply
1293 does not support PostScript. You may need to enable 'Automatic
1294 Format Detection' on your printer.</P
1301 NAME="AEN2182">14.4.8. Advanced Printing</H2
1303 >Note that you can do some pretty magic things by using your
1304 imagination with the "print command" option and some shell scripts.
1305 Doing print accounting is easy by passing the %U option to a print
1306 command shell script. You could even make the print command detect
1307 the type of output and its size and send it to an appropriate
1315 NAME="AEN2185">14.4.9. Real debugging</H2
1317 >If the above debug tips don't help, then maybe you need to bring in
1318 the bug guns, system tracing. See Tracing.txt in this directory.</P
1327 SUMMARY="Footer navigation table"
1347 HREF="samba-howto-collection.html"
1366 >Hosting a Microsoft Distributed File System tree on Samba</TD
1372 HREF="optional.html"
1380 >Unified Logons between Windows NT and UNIX using Winbind</TD