[cups.general] SOLVED: Kde and gnome-print make Samba-printingfail on Xerox Pahser 6350

Helge Blischke h.blischke at srz.de
Thu Sep 20 09:44:50 PDT 2007


Lukas Thiemeier wrote:
> 
> 
> Hi all,
> I decided to give some additional information about my problem, because 
> I solved it without understanding what was wrong.
> 
> I want my banners to be printed on red paper, but my printers do not 
> support selection of the bannerpage source. So I wrote a Bannerpage 
> myself, with
> "<</ManualFeed false /TraySwitch false /Duplex false /MediaPosition 4>> 
> setpagedevice"
>  in it, and put red paper into Tray 5 for all printers.
> This worked fine.
> Later, I decided to use a script running a2ps instead of the original
> texttops-filter. This worked, too, but the script did not manage the
> trayswitching correctly, so all textfiles were printed on red paper when
> printed with bannerpage.
> I added
> "serverdict begin 0 exitserver"
> to the end of my bannerpage, in order toreset the printer afer printing
> the bannerpage.
> (this is, what google told me when I asked for "postscript printer reset")
> This worked fine for a while, until someone used gnome-print and samba 
> printing crashed as described in my first mail.
> 
> "serverdict begin 0 exitserver" is not realy malformed, but this is the 
> line that was responsible for the error.
> I removed this line from the bannerpage and changed the a2ps-filter to 
> select the correct papertray, and now everything is up to normal.
> 
> I did not understand, why a "reset" in the bannerpage influences 
> printing through samba (only when gnome or kde was used before), while 
> everything else works realy fine! However, now it seems to work.
> 
> If anybody has an idea what was wrong, I'd be happy to hear about it.
> 
> Thanks a lot,
> Lukas
> 
> On Thu, 20 Sep 2007, Lukas Thiemeier wrote:
> 
>>
>> Thank you very much for your help!
>>
>> I finaly found out, there was a wrong line in my bannerpage.
>> I do not know why this problem only occured when printing from Gnome
>> or Kde before printing from a Windows machine. (this Bannerpage
>> is always printed)
>> However, removing this malformed line did solve the Problem.
>>
>> Best regards,
>> Lukas
>>

Well, the exitserver stuff is what caused the weird behaviour, as I
suspected earlier. If you look into the PLRM (PostScript Language
Reference Manual), you will learn that normally every job is
"encapsulated" in the sense that the environment at the beginning
of the job is preserved and restored immediately after the job.
The exitserver operator escapes from that behaviour and causes
any environmental changes made sine the start of the job to
be permanent.

The propoer way to achieve what you wanted is easy:
- begin your banner page with something like
	userdict/save_env save put
   which saves the current environment
- insert after the banner page's showpage
	userdict/save_env get restore
   to restore the original environment.

This approach is the recommended one for a lot of
similar specialities (like stapling parts of a job and so on).

I'd recommend to read the "Blue Book" (I don't remember the
correct title right now, but IIRC it is available as a PDF
file on the web).

Helge


-- 
Helge Blischke
Softwareentwicklung

H.Blischke at acm.org




More information about the cups mailing list