[SUGGESTION] switching trays in printjob

Kurt Pfeifle k1pfeifle at gmx.net
Fri Sep 7 10:37:36 PDT 2007


I was too quick, and therefor wrong.

Kurt Pfeifle wrote:
> Kurt Pfeifle wrote:
> 
>>> %%BeginSetup
>> [....]
>>> %%IncludeFeature: *PageSize A4
>>> } stopped cleartomark
>>> %%IncludeFeature: *InputSlot Tray3
>>> } stopped cleartomark
>>> %%EndSetup
>> [....]
>>
>>> %%Page: 2 2
>>> %%PageBoundingBox: 12 12 583 830
>>> %%BeginPageSetup
>>> %%IncludeFeature: *InputSlot Tray4
>>> } stopped cleartomark
>>> %%EndPageSetup
>> [....]
>>
>>> As far as I'm able to read PS, I can see that the actual PS file 
>>> contains the tray switching instructions, 
>> Yes.
> 
> Uhmmm.... actually, no. It does *not* contain valid code to switch
> the trays, AFAICS. It pretends to, but it doesn't work like that.
> 
> It contains "empty" code only. It should look similar to this:
> 
>   %%BeginSetup
>   [....]
>   %%IncludeFeature: *PageRegion A4
>   << /PageSize A4 [595 842] /ImageBBox null >> setpagedevice
>   } stopped cleartomark
>   %%IncludeFeature: *InputSlot Tray3
>   << /MediaPosition 3 >> setpagedevice
>   } stopped cleartomark
>   %%EndSetup
> 
>   [....]
> 
>   %%Page: 2 2
>   %%PageBoundingBox: 12 12 583 830
>   %%BeginPageSetup
>   %%IncludeFeature: *InputSlot Tray4
>   << /MediaPosition 4 >> setpagedevice
>   } stopped cleartomark
>   %%EndPageSetup


This example should have been (with "BeginFeature" instead of
"IncludeFeature"):

   %%BeginSetup
   [....]
   [{
   %%BeginFeature: *PageRegion A4
   << /PageSize A4 [595 842] /ImageBBox null >> setpagedevice
   %%EndFeature
   } stopped cleartomark
   [{
   %%BeginFeature: *InputSlot Tray3
   << /MediaPosition 3 >> setpagedevice
   %%EndFeature
   } stopped cleartomark
   %%EndSetup

   [....]

   %%Page: 2 2
   %%PageBoundingBox: 12 12 583 830
   %%BeginPageSetup
   [{
   %%BeginFeature: *InputSlot Tray4
   << /MediaPosition 4 >> setpagedevice
   %%EndFeature
   } stopped cleartomark
   %%EndPageSetup


In my haste, I overlooked that OOo uses the '%%IncludeFeature:' comment
and not the '%%Begin(End)Feature:' one.

As such, '%%IncludeFeature:' is valid and works.... *IF* all to-be-in-
cluded features *were* listed in the %%Prolog section of the PS file.
But they aren't. Therefor, nothing is 'included'.

There are 3 ways it could work:

 (a) Inside the "%%BeginProlog ... %%EndProlog" section, have valid
     definitions of all the device features including the PS/device
     code to be inserted. Then, in the "%%BeginPageSetup: ...
     %%EndPageSetup" sections it is enough to use a 1-line
     "%%InsertFeature: *InputSlot TrayXYZ" (where the string
     "*InputSlot TrayXYZ" must match the previous definition).

 (b) Just put the "%%InsertFeature: *InputSlot TrayXYZ" lines into the
     document, and expect the "document manager" to handle it by
     looking up the PPD and insert the correct PS snippet into
     the file. This is how OOo expects it ... however, CUPS is not
     a document manager that does do this.

 (c) Or, inside the "%%BeginPageSetup: ... %%EndPageSetup:" section
     use a multiline "%%BeginFeature: ....(PS Code here) %%EndFeature
     } stopped cleartomark" subsection.


(c) is the most robust, IMHO, because it would make OOo printfiles w
work as expected on the target printer, even in the absence of a
"document manager".

It is up to Mike to comment on his plans for CUPS to support the
'%%InsertFeature:' statements of PostScript files.

-- 
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