[Samba] CUPS printing from Windows

Kurt Pfeifle kpfeifle at danka.de
Thu Feb 26 19:46:40 GMT 2004

> [Samba] CUPS printing from Windows
> Alan Becker beckera at softrends.com
> Tue Feb 17 05:03:19 GMT 2004
> I have replaced a WinNT4 PDC with a Samba server. 


> Problem:  Windows clients (using downloaded drivers from print$) don't 
> seem to have full or proper control of printing.  Example 1: An excel 
> user has to click on "Print to fit" in Page setup in order for the page 
> to be scaled properly.  Otherwise it prints on multiple pages in very
> large type. 

This can also happen in a Windows-only environment.

> Example 2: Another Excel user attempts to set Landscape orientation.  
> The setting is accepted. no error is generated,
> but the page continues to print in portrait orientation.

Are your printer drivers installed locally or via "Point'n'Print"?
Are you using the native Windows drivers from the vendor or are you
using the CUPS or Adobe PostScript drivers (and let CUPS convert the
PS for you)?

> To begin with, this unit is based on RedHat 9 with all current updates 
> (kernel 2.4.20-28.9, 
> Samba 2.2.7a-8.9.0, Cups 1.1.17-  After discovering that CUPS 
> was the only
> printing system that RH9 installed, I went to the documentation and read 
> the HOWTO
> chapters 18 (Classical printing support) and 19 (CUPS printing support). 
> I then did the following:
> (1) Create the print queues using the RH/Gnome Printing control applet
> (2) Test printing from Linkx (ok)
> (3) Obtain the Windows drivers from the NT4 PDC (copied the whole
>    c:\winnt\...\w32x86 structure to a scratch area.
> (4) Obtain the detailed descriptions of each installed driver using the 
> rpcclient utility
>    from the Samba server, querying the old NT4 server (temporarily 
> attached) with the
>    getdriver "queue_name" function.  Route the query results to a file.  
> Repeat for all queues.
> (5) Write a script to parse the output of (4) and automate steps 4-10 of 
> "Manual
>    Driver Installation in 15 Steps" from Chapter 19. 
> (6) Run the script for each print queue.  Drivers appear to be added 
> without problem.

OK -- this seems to indicate that you are using the native drivers
for Windows provided by the vendor, just as you did on your NT print

> (7) Join a WinNT workstation to the Samba domain


> (8) As Administrator, connect to the laser print queue.  Succeeds, no 
> error message.
> (9) Bring up Excel, attempt to print Landscape as noted above. This fails.

What do you mean... "fails"??

--> Does printing fail altogether?
--> Or is it just not printing in landscape mode?

If it is the latter, and if you are using a PostScript driver on the
Windows clients, check out the Release Notes for CUPS:


I seem to remember that there was a "landscape/portrait" bugfix in the
latest 1.1.20 release...

Also, printing from Excel is sucking. Are you sure you had the correct

> Questions::
> (A) The failure to command the printer properly suggests a problem with 
> the uploaded drivers.

Not necessarily. These things happen in Windows-only places also....

> Are there any other common explanations for this type of 
> behavior??

Yes -- user error, driver bug.... Did it for sure work (using the same
driver settings) with the previous NT print server?

> (B) I attempted to set the dot-matrix queues to the Generic printer/Raw 
> device.  In this
> mode, I printed a short text file (in Linux), and copied a test file to 
> the network queue
> (under Windows).  In either case, the file was printed, but the paper 
> was not advanced
> to the next page. 

Why should it? If you send ASCII text, with no "page advance" command
at the end, the printer wouldn't know that you want the page advance....

> In other words, this queue is so raw that it doesn't 
> even recognise the end of a print job, 

It does what you tell it. You don't tell it that there is a page
advance needed. You should send an appropriate Escape code to the
dot matrix printer.

> so multiple print jobs can be printed on the same 
> page.  Is there any middle ground, where inter-job pagination occurs, 
> but no other filtering is enabled??

Yes. For a first insight see the CUPS documentation about writing
filters.(*) (If it is too much work for you, you could go to the new
"printing consultant's" page at


where you can buy some support. (If our company does it, 10% go to
Linuxprinting.org as sponsorship money).

(*) You need a filter for the dot-matrix which just adds the page
     advance command to any ASCII text file.  It can also be done via
     an "interface script". See "man lpadmin" and the "-i" paramter....

> TIA for your attention.
> A. Becker


More information about the samba mailing list