[SUGGESTION] switching trays in printjob

Kurt Pfeifle k1pfeifle at gmx.net
Thu Sep 6 06:26:24 PDT 2007


Philipp Morger wrote:
> Hallo Kurt
> 
>> That's *very* rare. *If* they want a page from a different slot, it
>> is 99% for the first page.
> 
> Maybe true, but I do have the case
> p1 -> t1
> p2 -> t2
> p3 -> t3
> (p4 -> t2)
> (p5 -> t3)
> p6 -> t5
> 
>>> Oh, that was "W2 UNG�LT PERS" -> Invalid personality, somehow the printer
>>> does not like the PS CUPS throws at it...
> 
>> Was this printed on a "PostScript error page" by the printer? Or where
>> did you see this message?
> 
> The HPLJ4P has an LED Display, where it's able to print such short things... 
> like "BEREIT" and "AUFWÄRMPHASE" and Stuff like that...
> 
>> Then you wasn't clear or I wasn't awake enough. I took your inquiry
>> as a need for Windows (and Unix) Ooo users to achieve that print output
>> feature via CUPS.
> 
> Well, folks at our site use Winword - this goes over samba to cups... a 
> pretty long way to debug, so I started at the source, which is cups, and
> as I don't have a Windows, I use OO; It has to work regardles of platform
> and office product anyway... so by not going via samba, I can exclude
> much of the possible failure possibilities -> right now, I can simply
> concentrate on solving the issue OO->CUPS in hope, by solving this I also
> solve O2K/OXP->Samba-CUPS.
> 
>> So for Windows users (who do not print via CUPS) it works, but you want
>> it for Unix users too (via CUPS)?
> 
> No, it does not work at all, for nobody at our site...
> 
>> No, in O2K I don't know this feature. Only the one where you select
>> "tray A for page 1" & "tray B for all the rest".
> 
> Am absolutely positive, that in O2K you are able to define a page per 
> section.
> 
> Wenn ich nicht irre, ist es unter Date/Seite einrichten, dort kann man 
> den Schacht auswählen und definieren, ob es für das ganze Dokument, 
> die aktuelle Sektion oder sowas oder ab der aktuellen Curserposition 
> sein soll. Ich kann jedenfalls ein in O2K so ohne Magie ein 5 seitiges 
> Dokument erstellen, wo jedes Seite aus einem der 5 Schächte käme.
> 
>> Unless your users insert some specific PS or PCL or MS code into their
>> Word pages into some hidden form fields... (which I also know about).
> 
> nope, we do not such black magic...
> 
>> For general apps on Unix it *should* work like I outlined in my last post.
>> Did you even try it with OOo?
> 
> The solution might work, no I didn't try it, because it doesn't solve 
> my issue and it doesn't solve that a functionality is broken in the 
> office application (tray selection per sheet) in OO as well as MS-O, 
> either directly via cups or by samba-cups
> 
>> However, if it is the same as it used to be years ago, here is the OOo
>> specific way (from memory):
>>
>>  * In OOo choose the program/dialog/menuitem were you define your
>>    "styles and formats"
>>
>>  * Define different page styles; Name one page style "FirstPage"
>>    (or whatever you like).
>>
>>  * Name your other styles differently (or keep one other style
>>    named "default".
>>
>> When you define each page style, you can assign a specific printer
>> tray to it (just don't use "autoselection" or "use printer settings"
>> with it). That should do the trick. It should make OOo output
>> PostScript code for printing that has specific tray selection code
>> injected for each page. (And make sure your CUPS is then *not* set
>> up to insert a *different* page code.)
> 
> That's *EXACLTY* the way I do it... how can I verify that CUPS is not 
> setup to insert a different page code? 

You can verify which is the default paper tray CUPS is using for a
specific printer (and a specific user) by issuing (as that user):

   lpoptions -p printername -l | grep InputSlot

The option marked with an asterisk ('*') is the default. You should
make sure that *NOT* any specific tray is enabled, but rather an
"Auto" tray.

Now, some PPDs do miss a $auto tray, and they will *always* make CUPS
insert additional tray-specific code into the file if it goes through
the pstops filter. In that case, you can edit the PPD. Search for
the '*OpenUI *InputSlot......*CloseUI *InputSlot' section. Simply
add this line:

*InputSlot Auto/Auto Select: ""

and make sure, that the default slot is set to "Auto":

*DefaultInputSlot: Auto

Because the "" definition is empty, no tray specific code will be
inserted into the jobfile when passing through the PPD file. (Hint:
after editing your PPD, make sure to run "cupstestppd -vv your.ppd"
to verify you've not b0rken it.)


Another 3 things:

(1)
If you print from CUPS/OOo, you can verify if OOo knows how to feed
the printer with "tray switching PostScript" by printing the file as
a "raw" job to CUPS ("raw" jobs bypass the CUPS filtering system).
To achieve that, you may want to create a separate "raw queue" (just
do not use any PPD for the queue). Or use OOo to "print to file",
and then print that file with "lp -d printer -o raw file").


(2)
When you print from Windows (and have a reasonably recent Samba),
you can use "cups options = raw" in smb.conf in order to force Samba
passing the job to CUPS with the "raw" commandline parameter. Or,
use a "raw queue" as the target of your Windows users. But of course,
the Windows clients must use the native driver provided by the vendor
for the MS Windows platform (not the PostScript driver added to Samba
via cupsaddsmb), if they print to a non-PostScript device. To verify
the Windows file works re. tray switching, make a user to "print to
file", transfer it to the CUPS server, and print it there with
"lp -o raw" again.

> And do you know if this works 
> with the hpijs backend?

Of course I don't *know*.  But it *should*.

> Grüsse
> Philipp


-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list