Let me ask you this, how are you planning on implementing your conditional code? Are you going to author some PostScript, perhaps using /BeginPage or /EndPage, and stick it at the top?
Or are you going to "insert" some PostScript, based on finding strings in your original PostScript? In other words, are you using some other language to "search" through your PostScript code?
Your PPD is telling you that this code selects Tray 1:
Code:
<</ManualFeed false /MediaPosition 3>> setpagedevice
So, if you find that within your PostScript, you know it's trying to print on Tray 1. You could possibly insert your logo code directly after that statement.
If you want to try it dynamically, using PostScript, you could use "currentpagedevice".
Code:
currentpagedevice /ManualFeed get not
currentpagedevice /MediaPosition 3 get and
{ %% on Tray 1
%% do logo here
} if
You would wrap all of that up into a /BeginPage procedure, which gets called each time there is a showpage, so that it would execute on each page.
Code:
<<
/BeginPage
{
pop
currentpagedevice /ManualFeed get not
currentpagedevice /MediaPosition 3 get and
{ %% on Tray 1
%% do logo here
} if
} bind
>> setpagedevice
Further, you should encode your logo as a PostScript Form, so the display list is cached for better performance. More information about that is available in articles I've written on my site.
All code posted here is untested!
Thomas D. Greer