3

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.

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
metagen
  • 43
  • 1
  • 6

1 Answers1

2

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.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • thank you for your input. I know that the paper tray selection is device-specific. for this reason, the manufacturer delivers a PPD, which *should* define this device-specific code. but as mentioned, this is not the case... I downloaded the PPDs directly from the manufacturers, that's why I'm wondering. I know for sure that the printer has these trays. using the commands like in the first example would work fine. how would you handle that? throw an error? – metagen Oct 27 '14 at 14:33
  • No, I'd just embed what the manufacturer told me to, from the PPD file (ie nothing, in this case). As you correctly say, that's what you are supposed to do. I'd have to suppose that the manufacturer made a mistake, or doesn't support tray switching form PostScript. Though in that case they should not offer the option in the PPD, as its would lead to operator confusion when selecting an option and having it fail..... – KenS Oct 27 '14 at 16:54