postscriptppd

How to handle empty paper tray selection code in a PPD file?


I'm writing a program which adds paper tray selection commands into a PostScript file. now I'd like to add them regarding a user-selected PPD file, which should contain the paper tray selection commands. for example, in a specific PPD I find the following lines:

*InputSlot Tray1/Tray 1:  "<< /MediaPosition 0 /TraySwitch false >> setpagedevice"
*InputSlot Tray2/Tray 2:  "<< /MediaPosition 1 /TraySwitch false >> setpagedevice"
*InputSlot Tray3/Tray 3:  "<< /MediaPosition 2 /TraySwitch false >> setpagedevice"

in another PPD I find these lines:

*InputSlot tray1/tray1: ""
*InputSlot tray2/tray2: ""
*InputSlot tray3/tray3: ""

I already consulted the PPD spec of Adobe, but I couldn't find any information about handling such empty InputSlot commands. is there a common way what to do? any suggestions are very welcome.


Solution

  • Paper tray selection is device-specific, so you need to use whatever is correct for the device.

    The second PPD you quote is nuts, I suspect that this simply means the device in question doesn't have multiple trays and someone copied the PPD from another device which did, and then in the usual 'monkey see monkey do' approach, 'fixed' it by deleting the PostScript between the speech marks, so that nothing gets emitted to setpagedevice.

    To be blunt the second example is simply incorrect.