Printing from a hodgepodge of Windows clients

Helge Blischke h.blischke at acm.org
Tue Sep 13 06:10:18 PDT 2011


Steve Bergman wrote:

> I have a situation where I'm mostly only in charge of the CUPS print
> server on a network where each Windows user is his or her own Windows
> admin whether they know what they are doing or not. They print via Samba
> which has been queuing the jobs to CUPS with the 'raw' option. This has
> worked reasonably well, all things considered. But I'm having instances
> where misconfigured Windows boxes are sending raw PDF images to printers
> that can't handle PDF. As of this evening I've removed the 'cups options =
> raw' line from Samba's smb.conf file.
> 
> Looking at the mime configuration, and if I'm reading it right, postscript
> print jobs will be handled just like postscript jobs from another CUPS
> spooler, PCL will be handled as 'raw', and PDF's will be processed to
> postscript, just as the spooler is currently doing for the Linux print
> jobs.
> 
> Am I correct? Is this a reasonable thing to do? Any caveats?
> 
> Also, when a postscript job gets queued without the 'raw' option... what
> does happen? Is it sent on through unchanged? Or is there some processing
> done on it before it goes to the printer?
> 
> Thanks,
> Steve Bergman

As for PostScript jobs: they are by default (unless CUPS as been configured 
differently) fed through the pstops filter which evaluates all defaults and 
job specific settings from the printer's PPD. This may conflict with the job 
settings specified by the Windows printing system (PSCRIPT5 normally), which 
may produce results other than the submitter of the job may have intended.

My suggestion to your problem is as follows:

*) in your smb.conf, replace "printing = cups" by e.g. printing =SYSV or  
BSD.

*) Write a script (Shell, Perl, Python, or whatever you like), say, 
process_windows_stuff, which by itself determines the document type of a 
print job, e.g. using the file command (the magic file your system's file 
command uses should be recent enough, otherwise you need to extend it a 
little bit). Depending on the evaluated file type, emit a print command like
	lpr -r -P$1 -o raw $2
for print jobs consisting of PCL or PostScript data (provided the respecive 
printer does accept both languages as native printing languages),
and
	lpr -r -P$1 -o document-format=application/vnd.windows-pdf $2
in case of PDF.
Specify this script in smb conf as printing commane:
print command = process_windwos_stuff %p %s

*) To your CUPS configuration (by default in /etc/cups) add a file, say
steve.convs, which contains the following line:
application/vnd.windows-pdf    application/vnc.cups-postscript  30  pdftops
This causes thre PDF converted to PostScript but skips the pstops filter.

Well, depending on the various special details of your overall 
configuration, you may need to tweak this skeleton to your needs, but I 
think this approach will settle your problem with the least effort.

Helge





More information about the cups mailing list