🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
3 messages
3 total messages Started by Martin Dulieu Fri, 25 Oct 2002 12:00
Putting intelligence into .ppd file
#1360
Author: Martin Dulieu
Date: Fri, 25 Oct 2002 12:00
56 lines
3323 bytes
Is it possible to do what I'm trying? 

I have multiple Solaris systems. An application on a central machine needs the ability to spool prints to various different printers on remote systems. 

The mechanism is: 

1. All printing is routed via a print-spooling mechnism which prints to remotely hosted printers. Thus the only valid queue name for the application is "bwps". 

2. The user chooses the correct final destination printer at the unix level prior to firing up the application. The choice is stored in the users $HOME directory in a file named ".printers" which contains the following columns: 
a) Real printer queue name 
b) Spooler queue which services it 
c) Location of printer 
d) Long description of printer type. 
e) Short description of printer type. 

3. The application associates the default.ppd file with the bwps "queue" 

4. The default.ppd file contains the line: *Include: "datap462_a4.ppd". 

5. The datap462_a4.ppd file contains the correct settings for OCE printers, including the lines: 
* OpenUI *InputSlot: PickOne 
* OrderDependency: 20 AnySetup 
* InputSlot 
* DefaultInputSlot: Upper 
* InputSlot Upper: "0 statusdict /setpapertray get exec" 
* InputSlot Lower: "1 statusdict /setpapertray get exec" 
* ?InputSlot: " save 
 [ (Upper) (Lower) ] statusdict /papertray get exec 
 (get exec) stopped ( pop pop (Unknown)} if = flush 
restore 

6. This works properly for OCE printers, but if the eventual printer is an HP4100N (which only has one tray), the error message: 
ERROR: configurationerror 
OFFENDINGCOMMAND: setpapertray 

STACK: 

-dictionary 
- mark- 
1 

is produced (it's complaining that the postscript header tried to configure a second paper tray). 

7. If the line: 
* InputSlot Lower: "1 statusdict /setpapertray get exec" 
is removed, the application can print to the HP printers, but not the OCE printers. 

8. Ideally what is wanted (smallest change), is some form of filter within the datap462_a4.ppd file such that the second InputSlot line will only be read for OCE printers, and skipped if the printer is a HP. 

9. In other words, when building the postscript headers, code in the datap462_a4.ppd file needs to do the equivalent of the unix command: 

grep bwps $HOME/.printers | grep hplj | wc 

then if the count were 0, we execute the second line, otherwise we skip it. 

10. I have no knowledge of Postscript programming, and so can't write this myself, (or even be certain it is possible - can Postscript program read the user's .printers file?).
Re: Putting intelligence into .ppd file
#1361
Author: Aandi Inston
Date: Fri, 25 Oct 2002 12:17
9 lines
1237 bytes
I don't think that's possible, or even reasonable.  That's counter to
the whole reason PPD files exist. PPD files generate PostScript that
runs inside the printer - no access to the original computer's filing
system.

If you have a workflow which treats printers as if they are generic,
then the workflow is faulty... sorry to say it...

Aandi Inston
Re: Putting intelligence into .ppd file
#1362
Author: Marc Antoni Malagarriga i Picas
Date: Fri, 25 Oct 2002 14:09
16 lines
1362 bytes
Hi Martin, 

You have the possibility to ask the *printername* and make a decision, like: 

statusdict begin 
80 string printername (The OCE Printer Name) eq 
{end 1 statusdict /setpapertray get exec}{end}ifelse 

In this case only the OCE printer executes the "1 statusdict /setpapertray get exec" paper tray call. But you need to known the internal OCE *printername*, of course ! 

They are other device dependent operators, like *product* with similar behaviour. 

Hope this helps, 

MaRC anToni (][ www.femfum.com 
PostScript&PDF Tools Developers
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads